Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: RootBound on Sun 13/08/2023 16:31:29

Title: Ctrl+[ pauses game
Post by: RootBound on Sun 13/08/2023 16:31:29
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!
Title: Re: Ctrl+[ pauses game
Post by: Crimson Wizard on Sun 13/08/2023 17:10:03
You may try printing the received code and see if it matches anything in your script perhaps?
Title: Re: Ctrl+[ pauses game
Post by: RootBound on Tue 15/08/2023 15:03:17
Thanks. I'm not sure how to print the received code, though. Where would I be able to do that?
Title: Re: Ctrl+[ pauses game
Post by: Crimson Wizard on Tue 15/08/2023 15:34:56
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.
Title: Re: Ctrl+[ pauses game
Post by: RootBound on Tue 15/08/2023 20:09:17
Understood. Will try this. Thank you
Title: Re: Ctrl+[ pauses game
Post by: RootBound on Wed 16/08/2023 02:54:24
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
Title: Re: Ctrl+[ pauses game
Post by: Crimson Wizard on Wed 16/08/2023 03:55:43
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.
Title: Re: Ctrl+[ pauses game
Post by: morganw on Sun 20/08/2023 17:55:26
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 (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.