Skip to content

Help solving cross-platform key code mess using GYB and parsing others work.

License

Notifications You must be signed in to change notification settings

gujor/swift-key-codes

Repository files navigation

   |/       /"                                                                  ( _ )
   |\ E Y   \_ O D E S                                   <¨\_/                  ´* *`
 /¨¨¨¨¨¨¨\/¨¨¨¨¨¨¨¨¨¨¨¨¨\/\                        0x29!´   ``                   \o/
´        /              ´  \_                                     (¨)           ,
        ´                    ´\                            0x29?  /__\       I'm Satan!
"Because key code knowledge     \                      ,^----------||----------------------·
is crucial when danger arrives"  `~~~~~~~~~~~~~~~~~~~~´
- BG

Key Codes

This package assists with creating platform-independent keyboard handling by providing key code mappings between different platforms.

Note: This package is published while being in its infancy. Structure will change. Rebase and force pushing will be done.

Modules

AppleKeyCodes

AppleKeyCodes maps between iOS and macOS key codes using USB keyboard codes.

More modules

TODO: Add modules for conversion between USB, evdev, XKB, Win and macOS.

Generate

Data sources and naive Python parsers are located at /generate/data_source. Parsed data is available at /generate/data.

Currently, these sources are available:

GYB (Generate Your Boilerplate) is Python script for generating Swift code using a templating system. It is used for generating the code in the modules.

Resources

License

This library is released under the MIT license. See LICENSE for details.

How key code data source license is handled:
  • If license is permissive:
    • Include license and data source files.
    • Example
  • else
    • Exclude license and data source file.
    • Include only parser output.
    • Mention why file is missing in parser.
    • Only parse and share data that is "safe".
    • Example

Contact repository owner if data source license is violated.

About

Help solving cross-platform key code mess using GYB and parsing others work.

Resources

License

Stars

Watchers

Forks