Ctrl+[ pauses game

Started by RootBound, Sun 13/08/2023 16:31:29

Previous topic - Next topic

RootBound

Odd discovery here. @Nahuel found while playtesting my game (AGS 3.5.1) that pressing Ctrl+[ pauses the game.

This combination does not even seem to be an option in the drop-down list under on_key_press, and there also doesn't seem to be a game.pause_key listed in the game variables like there is with game.abort_key.

Is this a hard-coded debug feature? Ctrl+P is one of my pause keys in the game, and the [ key is right next to P, as Nahuel pointed out to me, but maybe that's unrelated.

This isn't necessarily a problem, but I couldn't find an explanation for it anywhere, so I figured I'd ask in case it needs to be documented somewhere.

Thanks!
J. They/them. Here are my most recent games:

Crimson Wizard

You may try printing the received code and see if it matches anything in your script perhaps?

RootBound

Thanks. I'm not sure how to print the received code, though. Where would I be able to do that?
J. They/them. Here are my most recent games:

Crimson Wizard

Quote from: RootBound on Tue 15/08/2023 15:03:17I'm not sure how to print the received code, though. Where would I be able to do that?

Something like Display("%c", keycode) or System.Log("%c", keycode), for instance.

RootBound

Understood. Will try this. Thank you
J. They/them. Here are my most recent games:

RootBound

Evidently Ctrl+[ is being received as keycode 27 which according to the table at https://adventuregamestudio.github.io/ags-manual/Keycodes.html is Escape. This explains why the game is pausing since Escape is one of my chosen pause keys. But why would Ctrl+[ trigger escape?  :-\ 

This is 3.5.1.22
J. They/them. Here are my most recent games:

Crimson Wizard

Quote from: RootBound on Wed 16/08/2023 02:54:24But why would Ctrl+[ trigger escape?  :-\ 

This is 3.5.1.22

This is just how the codes for combinations were made in AGS.

Since 3.6.0 the on_key_press receives a key and mod separately, so this is less of an issue.

morganw

Quote from: RootBound on Wed 16/08/2023 02:54:24Evidently Ctrl+[ is being received as keycode 27 which according to the table at https://adventuregamestudio.github.io/ags-manual/Keycodes.html is Escape. This explains why the game is pausing since Escape is one of my chosen pause keys. But why would Ctrl+[ trigger escape?

It isn't a weird AGS thing, it is a weird legacy thing from the way some (non-printable) characters needed to be entered on old terminals. For example, CTRL+m is the same as pressing the return key, CTRL+h is the same as pressing the backspace key, and CTRL+i is the same as pressing the tab key.

SMF spam blocked by CleanTalk