Keyx and Key.Raw in OnEvent

Home Forums Monkey 2 Development Keyx and Key.Raw in OnEvent

This topic contains 2 replies, has 2 voices, and was last updated by  abakobo 6 days, 12 hours ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11651

    abakobo
    Participant

    1-Maybe I’ve missed somthing on how to use enums but..
    When trying to us some Key.Raw mask within OnEvent I get no result..

    2-With an Azerty keyboard Key.Key1 is working as if the Keyboard was a Qwerty keyboard on W10 (you have to shift to get the numbers on Azerty’s), but on Mac and Linux I can have the Key.Key1 working only with the Key.Raw combination (and thus only withing OnRender with device.Keyboard.KeyDown as mentionned on point 1 of this topic)

    How is it managed in ted2? There it works fine except for the numpad when numlock is off on Mac (doing both actions number+move)

    Am I missing somthing or should I post an issue?

    Here is a test code, you can switch the keyboard layout while the tester is running..

    #11657

    Mark Sibly
    Keymaster

    When trying to us some Key.Raw mask within OnEvent I get no result..

    Key.Raw mask is only intended for use with keyboard.KeyDown, not events. KeyDown/KeyUp events are always virtual keys.

    Use KeyChar events for ‘typed’ characters which are unicode and take into account local shift key layout etc.

    In general use KeyDown for ‘control’ keys like arrows, ‘home’, ‘end’ etc. and KeyChar for ‘typed’ keys that have text/unicode representation.

    #11693

    abakobo
    Participant

    Use KeyChar events for ‘typed’ characters

    Ok Thanks!

    There’s still the point n°2: The Key.Key0 to Key.Key9 is not behaving the same on Windows than on Mac/Linux (using an azerty keyboard). The way it is on Windows is the good one IMHO. i.e. Key.Keyx is considered as Raw (and on Mac/Linux you don’t get a Key.Keyx even if you shift).

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.