atomize-modules #7

Merged
sashakoshka merged 5 commits from atomize-modules into main 2023-02-02 15:51:23 -07:00
4 changed files with 124 additions and 120 deletions
Showing only changes of commit 99942466f8 - Show all commits

View File

@ -3,64 +3,64 @@ package x
import "unicode" import "unicode"
import "github.com/jezek/xgb/xproto" import "github.com/jezek/xgb/xproto"
import "github.com/jezek/xgbutil/keybind" import "github.com/jezek/xgbutil/keybind"
import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/input"
// when making changes to this file, look at keysymdef.h and // when making changes to this file, look at keysymdef.h and
// https://tronche.com/gui/x/xlib/input/keyboard-encoding.html // https://tronche.com/gui/x/xlib/input/keyboard-encoding.html
var buttonCodeTable = map[xproto.Keysym] tomo.Key { var buttonCodeTable = map[xproto.Keysym] input.Key {
0xFFFFFF: tomo.KeyNone, 0xFFFFFF: input.KeyNone,
0xFF63: tomo.KeyInsert, 0xFF63: input.KeyInsert,
0xFF67: tomo.KeyMenu, 0xFF67: input.KeyMenu,
0xFF61: tomo.KeyPrintScreen, 0xFF61: input.KeyPrintScreen,
0xFF6B: tomo.KeyPause, 0xFF6B: input.KeyPause,
0xFFE5: tomo.KeyCapsLock, 0xFFE5: input.KeyCapsLock,
0xFF14: tomo.KeyScrollLock, 0xFF14: input.KeyScrollLock,
0xFF7F: tomo.KeyNumLock, 0xFF7F: input.KeyNumLock,
0xFF08: tomo.KeyBackspace, 0xFF08: input.KeyBackspace,
0xFF09: tomo.KeyTab, 0xFF09: input.KeyTab,
0xFE20: tomo.KeyTab, 0xFE20: input.KeyTab,
0xFF0D: tomo.KeyEnter, 0xFF0D: input.KeyEnter,
0xFF1B: tomo.KeyEscape, 0xFF1B: input.KeyEscape,
0xFF52: tomo.KeyUp, 0xFF52: input.KeyUp,
0xFF54: tomo.KeyDown, 0xFF54: input.KeyDown,
0xFF51: tomo.KeyLeft, 0xFF51: input.KeyLeft,
0xFF53: tomo.KeyRight, 0xFF53: input.KeyRight,
0xFF55: tomo.KeyPageUp, 0xFF55: input.KeyPageUp,
0xFF56: tomo.KeyPageDown, 0xFF56: input.KeyPageDown,
0xFF50: tomo.KeyHome, 0xFF50: input.KeyHome,
0xFF57: tomo.KeyEnd, 0xFF57: input.KeyEnd,
0xFFE1: tomo.KeyLeftShift, 0xFFE1: input.KeyLeftShift,
0xFFE2: tomo.KeyRightShift, 0xFFE2: input.KeyRightShift,
0xFFE3: tomo.KeyLeftControl, 0xFFE3: input.KeyLeftControl,
0xFFE4: tomo.KeyRightControl, 0xFFE4: input.KeyRightControl,
0xFFE7: tomo.KeyLeftMeta, 0xFFE7: input.KeyLeftMeta,
0xFFE8: tomo.KeyRightMeta, 0xFFE8: input.KeyRightMeta,
0xFFE9: tomo.KeyLeftAlt, 0xFFE9: input.KeyLeftAlt,
0xFFEA: tomo.KeyRightAlt, 0xFFEA: input.KeyRightAlt,
0xFFEB: tomo.KeyLeftSuper, 0xFFEB: input.KeyLeftSuper,
0xFFEC: tomo.KeyRightSuper, 0xFFEC: input.KeyRightSuper,
0xFFED: tomo.KeyLeftHyper, 0xFFED: input.KeyLeftHyper,
0xFFEE: tomo.KeyRightHyper, 0xFFEE: input.KeyRightHyper,
0xFFFF: tomo.KeyDelete, 0xFFFF: input.KeyDelete,
0xFFBE: tomo.KeyF1, 0xFFBE: input.KeyF1,
0xFFBF: tomo.KeyF2, 0xFFBF: input.KeyF2,
0xFFC0: tomo.KeyF3, 0xFFC0: input.KeyF3,
0xFFC1: tomo.KeyF4, 0xFFC1: input.KeyF4,
0xFFC2: tomo.KeyF5, 0xFFC2: input.KeyF5,
0xFFC3: tomo.KeyF6, 0xFFC3: input.KeyF6,
0xFFC4: tomo.KeyF7, 0xFFC4: input.KeyF7,
0xFFC5: tomo.KeyF8, 0xFFC5: input.KeyF8,
0xFFC6: tomo.KeyF9, 0xFFC6: input.KeyF9,
0xFFC7: tomo.KeyF10, 0xFFC7: input.KeyF10,
0xFFC8: tomo.KeyF11, 0xFFC8: input.KeyF11,
0xFFC9: tomo.KeyF12, 0xFFC9: input.KeyF12,
// TODO: send this whenever a compose key, dead key, etc is pressed, // TODO: send this whenever a compose key, dead key, etc is pressed,
// and then send the resulting character while witholding the key // and then send the resulting character while witholding the key