-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AwtKeyInput Missing Keycodes for "PrintScreen" #682
Comments
Is this key the same on all platforms? If so, I see no reason why we should not support it. |
The original report comes from linux. |
I can check linux, can you check what windows does? |
Sadly I can't. Ubuntu here. |
XD, so does ubuntu does this then? |
Yup, it was me reporting it to MeFisto ;P
|
You can use KeyEvent.VK_PRINTSCREEN but there is no such key under Mac OS X as far as I know. |
I would like to take this issue. I have got a question though: What Code does the Key "PrintScreen" belongs to? |
A bit background here: Furthermore what about KEY_LAST? It would need to be increased and hence breaking compatibility for anyone relying on this being 0xE0 instead of referring to KEY_LAST (which can be ignored maybe, because it would be misuse). |
So it's okay to just increase LAST_KEY to 0xE1 and give PRINT_SCREEN the value of 0xE0 ? |
I think someone has not done a great job of explaining what the real issue is because I capture the Prt Scr button on Windows all the time... in fact, I guess it's the default mapping for the screen shot app state.... which I guess is really the Sys Req key on all of my keyboards: ...so I guess there are keyboards that do not pair these? As far as this: |
I've just done some research: In 1984 the IBM Computer/AT had 84 keys instead of 83, because the Sysreq Key was added. however since 1987 it has been consolidated with the Print Screen Key. This would mean:
|
Yeah, and I think adding the keycode is easy. Just add the constant. It sounds like it should be 154: ...which there is no KeyInput value for yet. (154 = 0x9a) ...so there is room for it there. (Then change the appropriate places in the system-specific event classes of course.. AwtKeyInput in this case.) |
We've done some further investigation as the fix didn't work as expected and it turns out that this issue only applies to the The Problem here is if we add However hacking |
If an app wants to respond to print screen then they should register to listen to that. If they want to handle 90% of user's "hitting print screen" then they will also want to register for sys req. (Bottom line is we should not be interpretting intent at the key event processing level... if it's a separate print screen button then send that code. If it's a sys req button that happens to also be print screen then send the sys req code.) However, the fact that LWJGL doesn't even send it is a separate bug. |
Well technically I think LWJGL is just wrong there assuming that it's the SysReq Key because (at least according to wikipedia) the actual sysreq key is now rather a combination of alt + something else. How about a javadoc hint for KEY_PRINTSCREEN in combination with lwjgl? Because else everyone falls into the pit of "why doesn't print screen listen to a keypress of "print screen"". |
That seems reasonable... Mention that it's for separate prt scrn buttons
only (and consider using prt screen instead of "print screen"... See the
other constants.)... And that for most use cases you really want sys req.
It's a similar issue with enter and numpad enter (which is actually the
regular enter let on Macs)
…On Jan 14, 2018 6:01 AM, "MeFisto94" ***@***.***> wrote:
Well technically I think LWJGL is just wrong there assuming that it's the
SysReq Key because (at least according to wikipedia) the actual sysreq key
is now rather a combination of alt + something else.
Awt might be querying the OS in a different way or is simply aware of the
difference.
How about a javadoc hint for KEY_PRINTSCREEN in combination with lwjgl?
Because else everyone falls into the pit of "why doesn't print screen
listen to a keypress of "print screen"".
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#682 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGrfnnFhIpv6MXPb0QOTdr9gCX82Qy7mks5tKd5xgaJpZM4OS6pq>
.
|
Oh, and the lwjgl thing is definitely a bug on their side and probably
deserves a mention in our docs... But anyone wanting to do actual "print
screen" behavior will always want at least sys req anyway.
…On Jan 14, 2018 6:04 AM, "Paul Speed" ***@***.***> wrote:
That seems reasonable... Mention that it's for separate prt scrn buttons
only (and consider using prt screen instead of "print screen"... See the
other constants.)... And that for most use cases you really want sys req.
It's a similar issue with enter and numpad enter (which is actually the
regular enter let on Macs)
On Jan 14, 2018 6:01 AM, "MeFisto94" ***@***.***> wrote:
> Well technically I think LWJGL is just wrong there assuming that it's the
> SysReq Key because (at least according to wikipedia) the actual sysreq key
> is now rather a combination of alt + something else.
> Awt might be querying the OS in a different way or is simply aware of the
> difference.
>
> How about a javadoc hint for KEY_PRINTSCREEN in combination with lwjgl?
> Because else everyone falls into the pit of "why doesn't print screen
> listen to a keypress of "print screen"".
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#682 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGrfnnFhIpv6MXPb0QOTdr9gCX82Qy7mks5tKd5xgaJpZM4OS6pq>
> .
>
|
Isn't it that most people rather know PrintScreen than SysRq? Or am I wrong? |
Only if you were born recently, I guess. Anyone who has ever mapped a key knows that the key is really keycode sys req. Lying to them and telling them that it's a prt scrn button is wrong. Just wrong wrong wrong. It's the sys req keycode. We should NOT NOT NOT be interpretting it as anything else at a low level key input API. That would be as horribly wrong as deciding that we should map letter keys differently to help the French play WASD based games on their keyboards. Do not interpret the keycodes. ...plus, then what would you do for those folks who really do want to let users map them differently. |
I created a pull request for this issue: |
Hi Nehon, thanks for merging. Can this issue be closed by now? |
…gine#806) * Adds missing key code for Print Screen and update javadoc (jMonkeyEngine#682)
Hey Guys,
As the SDK received an issue request that taking a screenshot while the SceneComposer is open leads to
unsupported key:154
being shown.After some research, I found out that https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-desktop/src/main/java/com/jme3/input/awt/AwtKeyInput.java#L375 or rather https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-desktop/src/main/java/com/jme3/input/awt/AwtKeyInput.java#L605 is responsible for that.
So if jme has a Key related to PrintScreen or if there are plans on allowing PrintScreen as a key tell me, so I can work on it.
The text was updated successfully, but these errors were encountered: