keyboard icon indicating copy to clipboard operation
keyboard copied to clipboard

Fix #585 Mac OS Ventura compatibility issue!

Open 0xGosu opened this issue 1 year ago • 4 comments

[fix bug for Mac OS Ventura where value of event.name is None] Add a default layout for mac OS incase unable to detect the layout key code automatically

0xGosu avatar Jan 11 '23 11:01 0xGosu

Tested with a Macbook Air M1 2020 model using latest Mac OS Ventura. Please merge with Squash commit when complete the review. Thanks!

0xGosu avatar Jan 11 '23 11:01 0xGosu

command key is ok, but option key are still error.

xtremforce avatar Apr 06 '23 16:04 xtremforce

Mac OS Ventura 13.5.1 on MacBook Pro M2 Pro, still got “KeyboardEvent(Unknown 1 down)”, event.name is None

zlaazlaa avatar Sep 07 '23 08:09 zlaazlaa

Mac OS Ventura 13.5.1 on MacBook Pro M2 Pro, still got “KeyboardEvent(Unknown 1 down)”, event.name is None

But I can distinguish keyboard event by str(event) thought the event.name is still None. Anyway, thanks to your pr!

key_event = keyboard.read_event()
if key_event.event_type == keyboard.KEY_DOWN:
    if str(key_event) == "KeyboardEvent(shift down)":
        print("press 'left shift'")
    elif str(key_event) == "KeyboardEvent(right shift down)":
        print("press 'left shift'")
    if paused:
        if str(key_event) == "KeyboardEvent(Unknown 34 down)":
            print("press 'i'")
        elif str(key_event) == "KeyboardEvent(Unknown 40 down)":
            print("press 'k'")
        elif str(key_event) == "KeyboardEvent(Unknown 38 down)":
            print("press 'j'")
        elif str(key_event) == "KeyboardEvent(Unknown 37 down)":
            print("press 'l'")

zlaazlaa avatar Sep 07 '23 09:09 zlaazlaa