Skip to content

Non-printables.. #3

@willwade

Description

@willwade

Non-printable characters..

I was thinking of creating a lookup table of aliases e.g:

key_aliases = {
    '\r': 0x24,
    '\t': 0x30,
    '\n': 0x24,
    'return' : 0x24,
    'tab' : 0x30,
    'space' : 0x31,
    'delete' : 0x33,
    'escape' : 0x35,
    'command' : 0x37,
    'shift' : 0x38,
    'capslock' : 0x39,
    'option' : 0x3A,
    'alternate' : 0x3A,
    'control' : 0x3B,
    'rightshift' : 0x3C,
    'rightoption' : 0x3D,
    'rightcontrol' : 0x3E,
    'function' : 0x3F,
    'home': 0x73,

which could then be used in tostring..
my thought though is whether this would work across different keyboard layouts.i.e. is it only the main letter keys that are fixed? Do you know at all?

Also - why is it pykeycode always gives 65535 for (some?) shifted forms e.g:

>>> keycode.tokeycode('!')
65535
>>> keycode.tokeycode('^')
65535

thanks again
will

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions