SysRq for Screenshots also accepts the spacebar in menu

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3196
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

SysRq for Screenshots also accepts the spacebar in menu

Post by drfrag »

DabbingSquidward wrote:the default binding of SysRq to Screenshots also accepts the spacebar.
It's this commit:
https://github.com/drfrag666/gzdoom/com ... c76cb3d0c8

The problem is adding the following line to GUIWndProcHook. It doesn't matter which key you put there.

Code: Select all

			case VK_SNAPSHOT:		ev.data1 = GK_SYSRQ;	break;
Is it a bug with the virtual key? It's supposed to work with Fn+Space too, weird.
Now what coud i do?
Last edited by drfrag on Thu Oct 31, 2019 5:50 am, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: SysRq for Screenshots also accepts the spacebar in menu.

Post by Graf Zahl »

Well, what can I say? I THINK there was a good reason why ZDoom did not support this particular key!
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3196
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by drfrag »

Thanks, that's the default key for screenshots. Turns out it has nothing to do, right now i've got no idea of what's going on but pressing space i menus takes three screenshots and it's not even a special GUI key.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3196
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by drfrag »

The key you use for screenshots doesn't matter, space always works and i don't know why. With PrtSC you get three shots pressing space instead of one tough.
Edit: now it only happens with SysRq.
Last edited by drfrag on Thu Oct 31, 2019 11:42 am, edited 4 times in total.
User avatar
Rachael
Posts: 13954
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by Rachael »

Have you taken a look at this? I suspect the problem lies with a lack of checks in this area.

Needless to say - and sorry to be pretty blunt - but the PR was marked WIP.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3196
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by drfrag »

There's nothing new there. The problem now only happens with PrtSc, i merged the PR after months of inactivity and i thought i could complete it. I added support for PrtSc myself. I don't know why i get the same keycode for SysRq and space in ev.KeyChar, it's not a problem with the checks there.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3196
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by drfrag »

I added Key_SysRq to the SpecialGUIKeys, Space is not a GUI key and it gets the same number as SysRq (32). I can't find the number of special GUI keys anywhere.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3196
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by drfrag »

But how can a non UI key trigger an UI event? I suspect there's some underlying problem. I could add Space to the UI keys if someone doesn't think of a better solution but that would be a hack.
User avatar
Rachael
Posts: 13954
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by Rachael »

I don't know all of what's going on but it seems to me that the code that is checking for keybind activations is not differentiating UI bind codes and regular binds. You are right that would be a hack - a horrific one at that and you should avoid it at all costs. Look for the code that is processing the inputs, instead, and make sure that when it is processing the screenshot key, it is only processing the non UI codes.

It might be necessary when a key event is received to store in a variable somewhere whether the key came in through a bind or through UI input.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by Graf Zahl »

Keybinds and UI events are entirely separate types, they cannot be mistaken for the other.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by randi »

GK_SYSRQ should have probably replaced GK_FREE1 or GK_FREE2 instead of being assigned to the same code as the space character.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3196
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: SysRq for Screenshots also accepts the spacebar in menu

Post by drfrag »

randi wrote:GK_SYSRQ should have probably replaced GK_FREE1 or GK_FREE2 instead of being assigned to the same code as the space character.
Sorry master, i tried... i tried. :lol:
It's great to see you around again, welcome back! :wub: Thanks very much!
Post Reply

Return to “Closed Bugs [GZDoom]”