Skip to content
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

Fix #585 Mac OS Ventura compatibility issue! #587

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

0xGosu
Copy link

@0xGosu 0xGosu commented Jan 11, 2023

[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
Copy link
Author

0xGosu commented Jan 11, 2023

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

@xtremforce
Copy link

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

@zlaazlaa
Copy link

zlaazlaa commented Sep 7, 2023

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

@zlaazlaa
Copy link

zlaazlaa commented Sep 7, 2023

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'")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants