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

Updated mac.py to be more simiar to windows.py #8

Merged
merged 3 commits into from
May 9, 2016

Conversation

SalvatoreTosti
Copy link

*Added diagnostic functionality to PyKeyboardEvent.
*Added stop function to mirror windows.py.
*Updated escape functionality to handler function.
*Added key_code_translate_table for value to key string lookup.

*Added diagnostic functionality to PyKeyboardEvent.
*Added stop function to mirror windows.py.
*Updated escape functionality to handler function.
*Added key_code_translate_table for value to key string lookup.
@pepijndevos
Copy link

I'm a bit hazy on the purpose on Windows of the lookup table. I vaguely remember some discussion about keyboard layouts. But Mac has universal keycodes, so that should not be an issue, I think?

Where did you get the values for the table from? It would be nice if the source was listed just as character_translate_table and special_key_translate_table.

Even nicer would be to get these values from PyObjC directly, but I'm not sure that's possible.

@pepijndevos
Copy link

Actually, it seems to be just the inverse of the other table? And only used in the diagnostics. So why not simply do something like

res = dict((v,k) for k,v in a.iteritems())

The key_code_translate_table is now generated programmatically by copying and and manipulating the keys and values in character_translate_table.
@SalvatoreTosti
Copy link
Author

SalvatoreTosti commented May 9, 2016

key_code_translate_table is now generated programmatically, in the manner described by @pepijndevos.

@pepijndevos pepijndevos merged commit 15f3f2a into PyUserInput:master May 9, 2016
@pepijndevos
Copy link

Thanks. I invited you to the organization as well.

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.

None yet

2 participants