SysRq for Screenshots also accepts the spacebar in menu

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: SysRq for Screenshots also accepts the spacebar in menu

Re: SysRq for Screenshots also accepts the spacebar in menu

by drfrag » Thu Oct 31, 2019 10:46 am

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!

Re: SysRq for Screenshots also accepts the spacebar in menu

by randi » Thu Oct 31, 2019 9:07 am

GK_SYSRQ should have probably replaced GK_FREE1 or GK_FREE2 instead of being assigned to the same code as the space character.

Re: SysRq for Screenshots also accepts the spacebar in menu

by Graf Zahl » Thu Oct 31, 2019 8:15 am

Keybinds and UI events are entirely separate types, they cannot be mistaken for the other.

Re: SysRq for Screenshots also accepts the spacebar in menu

by Rachael » Thu Oct 31, 2019 8:09 am

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.

Re: SysRq for Screenshots also accepts the spacebar in menu

by drfrag » Thu Oct 31, 2019 7:59 am

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.

Re: SysRq for Screenshots also accepts the spacebar in menu

by drfrag » Thu Oct 31, 2019 7:32 am

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.

Re: SysRq for Screenshots also accepts the spacebar in menu

by drfrag » Thu Oct 31, 2019 6:50 am

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.

Re: SysRq for Screenshots also accepts the spacebar in menu

by Rachael » Thu Oct 31, 2019 6:12 am

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.

Re: SysRq for Screenshots also accepts the spacebar in menu

by drfrag » Thu Oct 31, 2019 6:02 am

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.

Re: SysRq for Screenshots also accepts the spacebar in menu

by drfrag » Thu Oct 31, 2019 5:52 am

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.

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

by Graf Zahl » Thu Oct 31, 2019 5:49 am

Well, what can I say? I THINK there was a good reason why ZDoom did not support this particular key!

SysRq for Screenshots also accepts the spacebar in menu

by drfrag » Thu Oct 31, 2019 5:39 am

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?

Top