Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
keyDown on Mac - same event for "y" and "Shift" keys — Gideros Forum

keyDown on Mac - same event for "y" and "Shift" keys

I'm attempting my first release for the Mac OS. Well, Apple accepted it overnight, so it's published, but I've found an odd issue:

If I press the "y" key on my keyboard it triggers the keyDown event, with a event.keyCode of 89 and event.realCode of 16. If I press the Shift key it triggers a keyDown event with the same values for keyCode and realCode. I don't see any values in the event that allow me to tell which key was actually pressed.

Perhaps this is a symptom of using a Windows keyboard on the Mac, but everything else I do on the Mac with this keyboard seems to work.

Comments

  • hgy29hgy29 Maintainer
    Can check the modifiers field of the event ?
  • PaulHPaulH Member
    They're 0 for both keys:

    [text]=>""
    [modifiers]=>0
    [keyCode]=>89
    [realCode]=>16
  • hgy29hgy29 Maintainer
    Thanks for flagging, I will check this issue. This the ‘apple’ export right, not the Desktop one ?
  • PaulHPaulH Member
    Correct. I used the same Apple export to build for iOS without issues.
  • PaulHPaulH Member
    Have you had a chance to look into this, @hgy29? This is still an issue in version 2024.6.1. All other letter keys seem to work, but not the Y key on MacOS. I don't have a Mac keyboard, so I don't know if this only happens when using a Windows keyboard with the Mac, or if the KVM switch I'm using is an issue, but outside of a Gideros app the keys work as expected on the Mac. For me there's a workaround, since I have an on-screen keyboard too, so it's still possible to type the "Y" that way, but the lack of response to the keyboard seems buggy.
  • hgy29hgy29 Maintainer
    I thought I fixed it here: https://github.com/gideros/gideros/commit/af16cd38ad252600fab4f91a88a1cb11c6f34b4f

    It was already in 2024.6. I will double check in case I missed something

    Likes: MoKaLux, pie

    +1 -1 (+2 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    It seems to be ok here on my Mac, Shift and Y keys no longer have the same realCode and report the right keyCode.
  • hgy29hgy29 Maintainer
    It seems that the patch wasn't ported to prebuilt player, it is only applied to custom exports/players. I should remove the prebuilt player.
  • PaulHPaulH Member
    Interesting. I'm seeing it in a Mac app built from the export. Pressing Y doesn't type the letter, but behaves like shift key.
  • hgy29hgy29 Maintainer
    @PaulH,

    I only fixed the behavior you reported here:
    PaulH said:


    If I press the "y" key on my keyboard it triggers the keyDown event, with a event.keyCode of 89 and event.realCode of 16. If I press the Shift key it triggers a keyDown event with the same values for keyCode and realCode. I don't see any values in the event that allow me to tell which key was actually pressed.

    'Y' key was already reporting correct values, but Shift (and Alt, Control) was not. So now Shift key no longer reports itself as 'y' key.

Sign In or Register to comment.