[Fixed] SysRq for Screenshots also accepts the spacebar in menu

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

SysRq for Screenshots also accepts the spacebar in menu

Postby drfrag » Thu Oct 31, 2019 6: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 allExpand view
         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 6:50 am, edited 1 time in total.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

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

Postby Graf Zahl » Thu Oct 31, 2019 6:49 am

Well, what can I say? I THINK there was a good reason why ZDoom did not support this particular key!
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby drfrag » Thu Oct 31, 2019 6: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.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby drfrag » Thu Oct 31, 2019 7: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.
Last edited by drfrag on Thu Oct 31, 2019 12:42 pm, edited 4 times in total.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby Rachael » Thu Oct 31, 2019 7: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.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby drfrag » Thu Oct 31, 2019 7: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.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby drfrag » Thu Oct 31, 2019 8: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.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby drfrag » Thu Oct 31, 2019 8: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.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby Rachael » Thu Oct 31, 2019 9: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.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby Graf Zahl » Thu Oct 31, 2019 9:15 am

Keybinds and UI events are entirely separate types, they cannot be mistaken for the other.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby randi » Thu Oct 31, 2019 10: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.
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: SysRq for Screenshots also accepts the spacebar in menu

Postby drfrag » Thu Oct 31, 2019 11: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!
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain


Return to Closed Bugs

Who is online

Users browsing this forum: MSN [Bot] and 0 guests