by admin
Poker 3 Keyboard Layout
Python proof-of-concept for a Poker 3 keyboard layout emulator (not completed).
poker3.py
POK3R Custom Keyboard Firmware also POK3R RGB, Vortex Core, and others. Repositories Packages People Projects Dismiss Grow your team on GitHub. GitHub is home to over 50 million developers working together. Join them to grow your own development teams, manage permissions, and collaborate on. Vortex Poker 3 (POK3R) 60% Black Mechanical Keyboard Cherry MX Blue. Keyboard Layout: QWERTY (Standard) Color: White: Shipped with USPS First Class.
Poker 3 Keyboard Layout Software
#!/usr/bin/env python3 |
# Remaps the Caps Lock key to serve as an alternate function key to enable the |
# KBC Poker 3 keyboard layout on other keyboards. Be sure to disable Caps Lock |
# before using this ('setxkbmap -option caps:none'). |
fromevdevimportInputDevice, UInput, categorize, ecodes |
# TODO: Figure out how to automatically detect keyboards |
dev=InputDevice('/dev/input/event2') |
capson=False |
ui=UInput() |
# Injects a keystroke. |
definject(key): |
ui.write(ecodes.EV_KEY, key, 1) |
ui.write(ecodes.EV_KEY, key, 0) |
ui.syn() |
# Reads and acts on device input. We're specifically looking for keystrokes. |
foreventindev.read_loop(): |
ifevent.typeecodes.EV_KEY: |
# If the use has pressed or is holding Caps Lock, grab all device input. |
ifevent.code58: |
ifevent.value1: |
capson=True |
dev.grab() |
elifevent.value0: |
capson=False |
dev.ungrab() |
# If Caps Lock is down, check for the keys we're remapping. |
elifcapsonTrueand (event.value1orevent.value2): |
indices= { |
22: ecodes.KEY_PAGEUP, |
23: ecodes.KEY_UP, |
24: ecodes.KEY_PAGEDOWN, |
35: ecodes.KEY_HOME, |
36: ecodes.KEY_LEFT, |
37: ecodes.KEY_DOWN, |
38: ecodes.KEY_RIGHT, |
49: ecodes.KEY_END |
} |
# Try to inject our alternate keystroke. |
try: |
inject(indices[event.code]) |
except: |
continue |
Poker 3 Keyboard Layout Generator
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment