diff --git a/remarkable_mouse/codes.py b/remarkable_mouse/codes.py new file mode 100644 index 0000000..7743373 --- /dev/null +++ b/remarkable_mouse/codes.py @@ -0,0 +1,1082 @@ + + +EV_SYN = 0 +SYN_REPORT = 0 +SYN_CONFIG = 1 +SYN_MT_REPORT = 2 +SYN_DROPPED = 3 +SYN_04 = 4 +SYN_05 = 5 +SYN_06 = 6 +SYN_07 = 7 +SYN_08 = 8 +SYN_09 = 9 +SYN_0A = 10 +SYN_0B = 11 +SYN_0C = 12 +SYN_0D = 13 +SYN_0E = 14 +SYN_MAX = 15 + + +EV_KEY = 1 +KEY_RESERVED = 0 +KEY_ESC = 1 +KEY_1 = 2 +KEY_2 = 3 +KEY_3 = 4 +KEY_4 = 5 +KEY_5 = 6 +KEY_6 = 7 +KEY_7 = 8 +KEY_8 = 9 +KEY_9 = 10 +KEY_0 = 11 +KEY_MINUS = 12 +KEY_EQUAL = 13 +KEY_BACKSPACE = 14 +KEY_TAB = 15 +KEY_Q = 16 +KEY_W = 17 +KEY_E = 18 +KEY_R = 19 +KEY_T = 20 +KEY_Y = 21 +KEY_U = 22 +KEY_I = 23 +KEY_O = 24 +KEY_P = 25 +KEY_LEFTBRACE = 26 +KEY_RIGHTBRACE = 27 +KEY_ENTER = 28 +KEY_LEFTCTRL = 29 +KEY_A = 30 +KEY_S = 31 +KEY_D = 32 +KEY_F = 33 +KEY_G = 34 +KEY_H = 35 +KEY_J = 36 +KEY_K = 37 +KEY_L = 38 +KEY_SEMICOLON = 39 +KEY_APOSTROPHE = 40 +KEY_GRAVE = 41 +KEY_LEFTSHIFT = 42 +KEY_BACKSLASH = 43 +KEY_Z = 44 +KEY_X = 45 +KEY_C = 46 +KEY_V = 47 +KEY_B = 48 +KEY_N = 49 +KEY_M = 50 +KEY_COMMA = 51 +KEY_DOT = 52 +KEY_SLASH = 53 +KEY_RIGHTSHIFT = 54 +KEY_KPASTERISK = 55 +KEY_LEFTALT = 56 +KEY_SPACE = 57 +KEY_CAPSLOCK = 58 +KEY_F1 = 59 +KEY_F2 = 60 +KEY_F3 = 61 +KEY_F4 = 62 +KEY_F5 = 63 +KEY_F6 = 64 +KEY_F7 = 65 +KEY_F8 = 66 +KEY_F9 = 67 +KEY_F10 = 68 +KEY_NUMLOCK = 69 +KEY_SCROLLLOCK = 70 +KEY_KP7 = 71 +KEY_KP8 = 72 +KEY_KP9 = 73 +KEY_KPMINUS = 74 +KEY_KP4 = 75 +KEY_KP5 = 76 +KEY_KP6 = 77 +KEY_KPPLUS = 78 +KEY_KP1 = 79 +KEY_KP2 = 80 +KEY_KP3 = 81 +KEY_KP0 = 82 +KEY_KPDOT = 83 +KEY_54 = 84 +KEY_ZENKAKUHANKAKU = 85 +KEY_102ND = 86 +KEY_F11 = 87 +KEY_F12 = 88 +KEY_RO = 89 +KEY_KATAKANA = 90 +KEY_HIRAGANA = 91 +KEY_HENKAN = 92 +KEY_KATAKANAHIRAGANA = 93 +KEY_MUHENKAN = 94 +KEY_KPJPCOMMA = 95 +KEY_KPENTER = 96 +KEY_RIGHTCTRL = 97 +KEY_KPSLASH = 98 +KEY_SYSRQ = 99 +KEY_RIGHTALT = 100 +KEY_LINEFEED = 101 +KEY_HOME = 102 +KEY_UP = 103 +KEY_PAGEUP = 104 +KEY_LEFT = 105 +KEY_RIGHT = 106 +KEY_END = 107 +KEY_DOWN = 108 +KEY_PAGEDOWN = 109 +KEY_INSERT = 110 +KEY_DELETE = 111 +KEY_MACRO = 112 +KEY_MUTE = 113 +KEY_VOLUMEDOWN = 114 +KEY_VOLUMEUP = 115 +KEY_POWER = 116 +KEY_KPEQUAL = 117 +KEY_KPPLUSMINUS = 118 +KEY_PAUSE = 119 +KEY_SCALE = 120 +KEY_KPCOMMA = 121 +KEY_HANGEUL = 122 +KEY_HANJA = 123 +KEY_YEN = 124 +KEY_LEFTMETA = 125 +KEY_RIGHTMETA = 126 +KEY_COMPOSE = 127 +KEY_STOP = 128 +KEY_AGAIN = 129 +KEY_PROPS = 130 +KEY_UNDO = 131 +KEY_FRONT = 132 +KEY_COPY = 133 +KEY_OPEN = 134 +KEY_PASTE = 135 +KEY_FIND = 136 +KEY_CUT = 137 +KEY_HELP = 138 +KEY_MENU = 139 +KEY_CALC = 140 +KEY_SETUP = 141 +KEY_SLEEP = 142 +KEY_WAKEUP = 143 +KEY_FILE = 144 +KEY_SENDFILE = 145 +KEY_DELETEFILE = 146 +KEY_XFER = 147 +KEY_PROG1 = 148 +KEY_PROG2 = 149 +KEY_WWW = 150 +KEY_MSDOS = 151 +KEY_COFFEE = 152 +KEY_ROTATE_DISPLAY = 153 +KEY_CYCLEWINDOWS = 154 +KEY_MAIL = 155 +KEY_BOOKMARKS = 156 +KEY_COMPUTER = 157 +KEY_BACK = 158 +KEY_FORWARD = 159 +KEY_CLOSECD = 160 +KEY_EJECTCD = 161 +KEY_EJECTCLOSECD = 162 +KEY_NEXTSONG = 163 +KEY_PLAYPAUSE = 164 +KEY_PREVIOUSSONG = 165 +KEY_STOPCD = 166 +KEY_RECORD = 167 +KEY_REWIND = 168 +KEY_PHONE = 169 +KEY_ISO = 170 +KEY_CONFIG = 171 +KEY_HOMEPAGE = 172 +KEY_REFRESH = 173 +KEY_EXIT = 174 +KEY_MOVE = 175 +KEY_EDIT = 176 +KEY_SCROLLUP = 177 +KEY_SCROLLDOWN = 178 +KEY_KPLEFTPAREN = 179 +KEY_KPRIGHTPAREN = 180 +KEY_NEW = 181 +KEY_REDO = 182 +KEY_F13 = 183 +KEY_F14 = 184 +KEY_F15 = 185 +KEY_F16 = 186 +KEY_F17 = 187 +KEY_F18 = 188 +KEY_F19 = 189 +KEY_F20 = 190 +KEY_F21 = 191 +KEY_F22 = 192 +KEY_F23 = 193 +KEY_F24 = 194 +KEY_C3 = 195 +KEY_C4 = 196 +KEY_C5 = 197 +KEY_C6 = 198 +KEY_C7 = 199 +KEY_PLAYCD = 200 +KEY_PAUSECD = 201 +KEY_PROG3 = 202 +KEY_PROG4 = 203 +KEY_DASHBOARD = 204 +KEY_SUSPEND = 205 +KEY_CLOSE = 206 +KEY_PLAY = 207 +KEY_FASTFORWARD = 208 +KEY_BASSBOOST = 209 +KEY_PRINT = 210 +KEY_HP = 211 +KEY_CAMERA = 212 +KEY_SOUND = 213 +KEY_QUESTION = 214 +KEY_EMAIL = 215 +KEY_CHAT = 216 +KEY_SEARCH = 217 +KEY_CONNECT = 218 +KEY_FINANCE = 219 +KEY_SPORT = 220 +KEY_SHOP = 221 +KEY_ALTERASE = 222 +KEY_CANCEL = 223 +KEY_BRIGHTNESSDOWN = 224 +KEY_BRIGHTNESSUP = 225 +KEY_MEDIA = 226 +KEY_SWITCHVIDEOMODE = 227 +KEY_KBDILLUMTOGGLE = 228 +KEY_KBDILLUMDOWN = 229 +KEY_KBDILLUMUP = 230 +KEY_SEND = 231 +KEY_REPLY = 232 +KEY_FORWARDMAIL = 233 +KEY_SAVE = 234 +KEY_DOCUMENTS = 235 +KEY_BATTERY = 236 +KEY_BLUETOOTH = 237 +KEY_WLAN = 238 +KEY_UWB = 239 +KEY_UNKNOWN = 240 +KEY_VIDEO_NEXT = 241 +KEY_VIDEO_PREV = 242 +KEY_BRIGHTNESS_CYCLE = 243 +KEY_BRIGHTNESS_AUTO = 244 +KEY_DISPLAY_OFF = 245 +KEY_WWAN = 246 +KEY_RFKILL = 247 +KEY_MICMUTE = 248 +KEY_F9 = 249 +KEY_FA = 250 +KEY_FB = 251 +KEY_FC = 252 +KEY_FD = 253 +KEY_FE = 254 +KEY_FF = 255 +BTN_0 = 256 +BTN_1 = 257 +BTN_2 = 258 +BTN_3 = 259 +BTN_4 = 260 +BTN_5 = 261 +BTN_6 = 262 +BTN_7 = 263 +BTN_8 = 264 +BTN_9 = 265 +KEY_10A = 266 +KEY_10B = 267 +KEY_10C = 268 +KEY_10D = 269 +KEY_10E = 270 +KEY_10F = 271 +BTN_LEFT = 272 +BTN_RIGHT = 273 +BTN_MIDDLE = 274 +BTN_SIDE = 275 +BTN_EXTRA = 276 +BTN_FORWARD = 277 +BTN_BACK = 278 +BTN_TASK = 279 +KEY_118 = 280 +KEY_119 = 281 +KEY_11A = 282 +KEY_11B = 283 +KEY_11C = 284 +KEY_11D = 285 +KEY_11E = 286 +KEY_11F = 287 +BTN_TRIGGER = 288 +BTN_THUMB = 289 +BTN_THUMB2 = 290 +BTN_TOP = 291 +BTN_TOP2 = 292 +BTN_PINKIE = 293 +BTN_BASE = 294 +BTN_BASE2 = 295 +BTN_BASE3 = 296 +BTN_BASE4 = 297 +BTN_BASE5 = 298 +BTN_BASE6 = 299 +KEY_12C = 300 +KEY_12D = 301 +KEY_12E = 302 +BTN_DEAD = 303 +BTN_SOUTH = 304 +BTN_EAST = 305 +BTN_C = 306 +BTN_NORTH = 307 +BTN_WEST = 308 +BTN_Z = 309 +BTN_TL = 310 +BTN_TR = 311 +BTN_TL2 = 312 +BTN_TR2 = 313 +BTN_SELECT = 314 +BTN_START = 315 +BTN_MODE = 316 +BTN_THUMBL = 317 +BTN_THUMBR = 318 +KEY_13F = 319 +BTN_TOOL_PEN = 320 +BTN_TOOL_RUBBER = 321 +BTN_TOOL_BRUSH = 322 +BTN_TOOL_PENCIL = 323 +BTN_TOOL_AIRBRUSH = 324 +BTN_TOOL_FINGER = 325 +BTN_TOOL_MOUSE = 326 +BTN_TOOL_LENS = 327 +BTN_TOOL_QUINTTAP = 328 +BTN_STYLUS3 = 329 +BTN_TOUCH = 330 +BTN_STYLUS = 331 +BTN_STYLUS2 = 332 +BTN_TOOL_DOUBLETAP = 333 +BTN_TOOL_TRIPLETAP = 334 +BTN_TOOL_QUADTAP = 335 +BTN_GEAR_DOWN = 336 +BTN_GEAR_UP = 337 +KEY_152 = 338 +KEY_153 = 339 +KEY_154 = 340 +KEY_155 = 341 +KEY_156 = 342 +KEY_157 = 343 +KEY_158 = 344 +KEY_159 = 345 +KEY_15A = 346 +KEY_15B = 347 +KEY_15C = 348 +KEY_15D = 349 +KEY_15E = 350 +KEY_15F = 351 +KEY_OK = 352 +KEY_SELECT = 353 +KEY_GOTO = 354 +KEY_CLEAR = 355 +KEY_POWER2 = 356 +KEY_OPTION = 357 +KEY_INFO = 358 +KEY_TIME = 359 +KEY_VENDOR = 360 +KEY_ARCHIVE = 361 +KEY_PROGRAM = 362 +KEY_CHANNEL = 363 +KEY_FAVORITES = 364 +KEY_EPG = 365 +KEY_PVR = 366 +KEY_MHP = 367 +KEY_LANGUAGE = 368 +KEY_TITLE = 369 +KEY_SUBTITLE = 370 +KEY_ANGLE = 371 +KEY_FULL_SCREEN = 372 +KEY_MODE = 373 +KEY_KEYBOARD = 374 +KEY_ASPECT_RATIO = 375 +KEY_PC = 376 +KEY_TV = 377 +KEY_TV2 = 378 +KEY_VCR = 379 +KEY_VCR2 = 380 +KEY_SAT = 381 +KEY_SAT2 = 382 +KEY_CD = 383 +KEY_TAPE = 384 +KEY_RADIO = 385 +KEY_TUNER = 386 +KEY_PLAYER = 387 +KEY_TEXT = 388 +KEY_DVD = 389 +KEY_AUX = 390 +KEY_MP3 = 391 +KEY_AUDIO = 392 +KEY_VIDEO = 393 +KEY_DIRECTORY = 394 +KEY_LIST = 395 +KEY_MEMO = 396 +KEY_CALENDAR = 397 +KEY_RED = 398 +KEY_GREEN = 399 +KEY_YELLOW = 400 +KEY_BLUE = 401 +KEY_CHANNELUP = 402 +KEY_CHANNELDOWN = 403 +KEY_FIRST = 404 +KEY_LAST = 405 +KEY_AB = 406 +KEY_NEXT = 407 +KEY_RESTART = 408 +KEY_SLOW = 409 +KEY_SHUFFLE = 410 +KEY_BREAK = 411 +KEY_PREVIOUS = 412 +KEY_DIGITS = 413 +KEY_TEEN = 414 +KEY_TWEN = 415 +KEY_VIDEOPHONE = 416 +KEY_GAMES = 417 +KEY_ZOOMIN = 418 +KEY_ZOOMOUT = 419 +KEY_ZOOMRESET = 420 +KEY_WORDPROCESSOR = 421 +KEY_EDITOR = 422 +KEY_SPREADSHEET = 423 +KEY_GRAPHICSEDITOR = 424 +KEY_PRESENTATION = 425 +KEY_DATABASE = 426 +KEY_NEWS = 427 +KEY_VOICEMAIL = 428 +KEY_ADDRESSBOOK = 429 +KEY_MESSENGER = 430 +KEY_DISPLAYTOGGLE = 431 +KEY_SPELLCHECK = 432 +KEY_LOGOFF = 433 +KEY_DOLLAR = 434 +KEY_EURO = 435 +KEY_FRAMEBACK = 436 +KEY_FRAMEFORWARD = 437 +KEY_CONTEXT_MENU = 438 +KEY_MEDIA_REPEAT = 439 +KEY_10CHANNELSUP = 440 +KEY_10CHANNELSDOWN = 441 +KEY_IMAGES = 442 +KEY_1BB = 443 +KEY_NOTIFICATION_CENTER = 444 +KEY_PICKUP_PHONE = 445 +KEY_HANGUP_PHONE = 446 +KEY_1BF = 447 +KEY_DEL_EOL = 448 +KEY_DEL_EOS = 449 +KEY_INS_LINE = 450 +KEY_DEL_LINE = 451 +KEY_1C4 = 452 +KEY_1C5 = 453 +KEY_1C6 = 454 +KEY_1C7 = 455 +KEY_1C8 = 456 +KEY_1C9 = 457 +KEY_1CA = 458 +KEY_1CB = 459 +KEY_1CC = 460 +KEY_1CD = 461 +KEY_1CE = 462 +KEY_1CF = 463 +KEY_FN = 464 +KEY_FN_ESC = 465 +KEY_FN_F1 = 466 +KEY_FN_F2 = 467 +KEY_FN_F3 = 468 +KEY_FN_F4 = 469 +KEY_FN_F5 = 470 +KEY_FN_F6 = 471 +KEY_FN_F7 = 472 +KEY_FN_F8 = 473 +KEY_FN_F9 = 474 +KEY_FN_F10 = 475 +KEY_FN_F11 = 476 +KEY_FN_F12 = 477 +KEY_FN_1 = 478 +KEY_FN_2 = 479 +KEY_FN_D = 480 +KEY_FN_E = 481 +KEY_FN_F = 482 +KEY_FN_S = 483 +KEY_FN_B = 484 +KEY_FN_RIGHT_SHIFT = 485 +KEY_1E6 = 486 +KEY_1E7 = 487 +KEY_1E8 = 488 +KEY_1E9 = 489 +KEY_1EA = 490 +KEY_1EB = 491 +KEY_1EC = 492 +KEY_1ED = 493 +KEY_1EE = 494 +KEY_1EF = 495 +KEY_1F0 = 496 +KEY_BRL_DOT1 = 497 +KEY_BRL_DOT2 = 498 +KEY_BRL_DOT3 = 499 +KEY_BRL_DOT4 = 500 +KEY_BRL_DOT5 = 501 +KEY_BRL_DOT6 = 502 +KEY_BRL_DOT7 = 503 +KEY_BRL_DOT8 = 504 +KEY_BRL_DOT9 = 505 +KEY_BRL_DOT10 = 506 +KEY_1FB = 507 +KEY_1FC = 508 +KEY_1FD = 509 +KEY_1FE = 510 +KEY_1FF = 511 +KEY_NUMERIC_0 = 512 +KEY_NUMERIC_1 = 513 +KEY_NUMERIC_2 = 514 +KEY_NUMERIC_3 = 515 +KEY_NUMERIC_4 = 516 +KEY_NUMERIC_5 = 517 +KEY_NUMERIC_6 = 518 +KEY_NUMERIC_7 = 519 +KEY_NUMERIC_8 = 520 +KEY_NUMERIC_9 = 521 +KEY_NUMERIC_STAR = 522 +KEY_NUMERIC_POUND = 523 +KEY_NUMERIC_A = 524 +KEY_NUMERIC_B = 525 +KEY_NUMERIC_C = 526 +KEY_NUMERIC_D = 527 +KEY_CAMERA_FOCUS = 528 +KEY_WPS_BUTTON = 529 +KEY_TOUCHPAD_TOGGLE = 530 +KEY_TOUCHPAD_ON = 531 +KEY_TOUCHPAD_OFF = 532 +KEY_CAMERA_ZOOMIN = 533 +KEY_CAMERA_ZOOMOUT = 534 +KEY_CAMERA_UP = 535 +KEY_CAMERA_DOWN = 536 +KEY_CAMERA_LEFT = 537 +KEY_CAMERA_RIGHT = 538 +KEY_ATTENDANT_ON = 539 +KEY_ATTENDANT_OFF = 540 +KEY_ATTENDANT_TOGGLE = 541 +KEY_LIGHTS_TOGGLE = 542 +KEY_21F = 543 +BTN_DPAD_UP = 544 +BTN_DPAD_DOWN = 545 +BTN_DPAD_LEFT = 546 +BTN_DPAD_RIGHT = 547 +KEY_224 = 548 +KEY_225 = 549 +KEY_226 = 550 +KEY_227 = 551 +KEY_228 = 552 +KEY_229 = 553 +KEY_22A = 554 +KEY_22B = 555 +KEY_22C = 556 +KEY_22D = 557 +KEY_22E = 558 +KEY_22F = 559 +KEY_ALS_TOGGLE = 560 +KEY_ROTATE_LOCK_TOGGLE = 561 +KEY_232 = 562 +KEY_233 = 563 +KEY_234 = 564 +KEY_235 = 565 +KEY_236 = 566 +KEY_237 = 567 +KEY_238 = 568 +KEY_239 = 569 +KEY_23A = 570 +KEY_23B = 571 +KEY_23C = 572 +KEY_23D = 573 +KEY_23E = 574 +KEY_23F = 575 +KEY_BUTTONCONFIG = 576 +KEY_TASKMANAGER = 577 +KEY_JOURNAL = 578 +KEY_CONTROLPANEL = 579 +KEY_APPSELECT = 580 +KEY_SCREENSAVER = 581 +KEY_VOICECOMMAND = 582 +KEY_ASSISTANT = 583 +KEY_KBD_LAYOUT_NEXT = 584 +KEY_EMOJI_PICKER = 585 +KEY_24A = 586 +KEY_24B = 587 +KEY_24C = 588 +KEY_24D = 589 +KEY_24E = 590 +KEY_24F = 591 +KEY_BRIGHTNESS_MIN = 592 +KEY_BRIGHTNESS_MAX = 593 +KEY_252 = 594 +KEY_253 = 595 +KEY_254 = 596 +KEY_255 = 597 +KEY_256 = 598 +KEY_257 = 599 +KEY_258 = 600 +KEY_259 = 601 +KEY_25A = 602 +KEY_25B = 603 +KEY_25C = 604 +KEY_25D = 605 +KEY_25E = 606 +KEY_25F = 607 +KEY_KBDINPUTASSIST_PREV = 608 +KEY_KBDINPUTASSIST_NEXT = 609 +KEY_KBDINPUTASSIST_PREVGROUP = 610 +KEY_KBDINPUTASSIST_NEXTGROUP = 611 +KEY_KBDINPUTASSIST_ACCEPT = 612 +KEY_KBDINPUTASSIST_CANCEL = 613 +KEY_RIGHT_UP = 614 +KEY_RIGHT_DOWN = 615 +KEY_LEFT_UP = 616 +KEY_LEFT_DOWN = 617 +KEY_ROOT_MENU = 618 +KEY_MEDIA_TOP_MENU = 619 +KEY_NUMERIC_11 = 620 +KEY_NUMERIC_12 = 621 +KEY_AUDIO_DESC = 622 +KEY_3D_MODE = 623 +KEY_NEXT_FAVORITE = 624 +KEY_STOP_RECORD = 625 +KEY_PAUSE_RECORD = 626 +KEY_VOD = 627 +KEY_UNMUTE = 628 +KEY_FASTREVERSE = 629 +KEY_SLOWREVERSE = 630 +KEY_DATA = 631 +KEY_ONSCREEN_KEYBOARD = 632 +KEY_PRIVACY_SCREEN_TOGGLE = 633 +KEY_SELECTIVE_SCREENSHOT = 634 +KEY_27B = 635 +KEY_27C = 636 +KEY_27D = 637 +KEY_27E = 638 +KEY_27F = 639 +KEY_280 = 640 +KEY_281 = 641 +KEY_282 = 642 +KEY_283 = 643 +KEY_284 = 644 +KEY_285 = 645 +KEY_286 = 646 +KEY_287 = 647 +KEY_288 = 648 +KEY_289 = 649 +KEY_28A = 650 +KEY_28B = 651 +KEY_28C = 652 +KEY_28D = 653 +KEY_28E = 654 +KEY_28F = 655 +KEY_MACRO1 = 656 +KEY_MACRO2 = 657 +KEY_MACRO3 = 658 +KEY_MACRO4 = 659 +KEY_MACRO5 = 660 +KEY_MACRO6 = 661 +KEY_MACRO7 = 662 +KEY_MACRO8 = 663 +KEY_MACRO9 = 664 +KEY_MACRO10 = 665 +KEY_MACRO11 = 666 +KEY_MACRO12 = 667 +KEY_MACRO13 = 668 +KEY_MACRO14 = 669 +KEY_MACRO15 = 670 +KEY_MACRO16 = 671 +KEY_MACRO17 = 672 +KEY_MACRO18 = 673 +KEY_MACRO19 = 674 +KEY_MACRO20 = 675 +KEY_MACRO21 = 676 +KEY_MACRO22 = 677 +KEY_MACRO23 = 678 +KEY_MACRO24 = 679 +KEY_MACRO25 = 680 +KEY_MACRO26 = 681 +KEY_MACRO27 = 682 +KEY_MACRO28 = 683 +KEY_MACRO29 = 684 +KEY_MACRO30 = 685 +KEY_2AE = 686 +KEY_2AF = 687 +KEY_MACRO_RECORD_START = 688 +KEY_MACRO_RECORD_STOP = 689 +KEY_MACRO_PRESET_CYCLE = 690 +KEY_MACRO_PRESET1 = 691 +KEY_MACRO_PRESET2 = 692 +KEY_MACRO_PRESET3 = 693 +KEY_2B6 = 694 +KEY_2B7 = 695 +KEY_KBD_LCD_MENU1 = 696 +KEY_KBD_LCD_MENU2 = 697 +KEY_KBD_LCD_MENU3 = 698 +KEY_KBD_LCD_MENU4 = 699 +KEY_KBD_LCD_MENU5 = 700 +KEY_2BD = 701 +KEY_2BE = 702 +KEY_2BF = 703 +BTN_TRIGGER_HAPPY1 = 704 +BTN_TRIGGER_HAPPY2 = 705 +BTN_TRIGGER_HAPPY3 = 706 +BTN_TRIGGER_HAPPY4 = 707 +BTN_TRIGGER_HAPPY5 = 708 +BTN_TRIGGER_HAPPY6 = 709 +BTN_TRIGGER_HAPPY7 = 710 +BTN_TRIGGER_HAPPY8 = 711 +BTN_TRIGGER_HAPPY9 = 712 +BTN_TRIGGER_HAPPY10 = 713 +BTN_TRIGGER_HAPPY11 = 714 +BTN_TRIGGER_HAPPY12 = 715 +BTN_TRIGGER_HAPPY13 = 716 +BTN_TRIGGER_HAPPY14 = 717 +BTN_TRIGGER_HAPPY15 = 718 +BTN_TRIGGER_HAPPY16 = 719 +BTN_TRIGGER_HAPPY17 = 720 +BTN_TRIGGER_HAPPY18 = 721 +BTN_TRIGGER_HAPPY19 = 722 +BTN_TRIGGER_HAPPY20 = 723 +BTN_TRIGGER_HAPPY21 = 724 +BTN_TRIGGER_HAPPY22 = 725 +BTN_TRIGGER_HAPPY23 = 726 +BTN_TRIGGER_HAPPY24 = 727 +BTN_TRIGGER_HAPPY25 = 728 +BTN_TRIGGER_HAPPY26 = 729 +BTN_TRIGGER_HAPPY27 = 730 +BTN_TRIGGER_HAPPY28 = 731 +BTN_TRIGGER_HAPPY29 = 732 +BTN_TRIGGER_HAPPY30 = 733 +BTN_TRIGGER_HAPPY31 = 734 +BTN_TRIGGER_HAPPY32 = 735 +BTN_TRIGGER_HAPPY33 = 736 +BTN_TRIGGER_HAPPY34 = 737 +BTN_TRIGGER_HAPPY35 = 738 +BTN_TRIGGER_HAPPY36 = 739 +BTN_TRIGGER_HAPPY37 = 740 +BTN_TRIGGER_HAPPY38 = 741 +BTN_TRIGGER_HAPPY39 = 742 +BTN_TRIGGER_HAPPY40 = 743 +KEY_2E8 = 744 +KEY_2E9 = 745 +KEY_2EA = 746 +KEY_2EB = 747 +KEY_2EC = 748 +KEY_2ED = 749 +KEY_2EE = 750 +KEY_2EF = 751 +KEY_2F0 = 752 +KEY_2F1 = 753 +KEY_2F2 = 754 +KEY_2F3 = 755 +KEY_2F4 = 756 +KEY_2F5 = 757 +KEY_2F6 = 758 +KEY_2F7 = 759 +KEY_2F8 = 760 +KEY_2F9 = 761 +KEY_2FA = 762 +KEY_2FB = 763 +KEY_2FC = 764 +KEY_2FD = 765 +KEY_2FE = 766 +KEY_MAX = 767 + + +EV_REL = 2 +REL_X = 0 +REL_Y = 1 +REL_Z = 2 +REL_RX = 3 +REL_RY = 4 +REL_RZ = 5 +REL_HWHEEL = 6 +REL_DIAL = 7 +REL_WHEEL = 8 +REL_MISC = 9 +REL_RESERVED = 10 +REL_WHEEL_HI_RES = 11 +REL_HWHEEL_HI_RES = 12 +REL_0D = 13 +REL_0E = 14 +REL_MAX = 15 + + +EV_ABS = 3 +ABS_X = 0 +ABS_Y = 1 +ABS_Z = 2 +ABS_RX = 3 +ABS_RY = 4 +ABS_RZ = 5 +ABS_THROTTLE = 6 +ABS_RUDDER = 7 +ABS_WHEEL = 8 +ABS_GAS = 9 +ABS_BRAKE = 10 +ABS_0B = 11 +ABS_0C = 12 +ABS_0D = 13 +ABS_0E = 14 +ABS_0F = 15 +ABS_HAT0X = 16 +ABS_HAT0Y = 17 +ABS_HAT1X = 18 +ABS_HAT1Y = 19 +ABS_HAT2X = 20 +ABS_HAT2Y = 21 +ABS_HAT3X = 22 +ABS_HAT3Y = 23 +ABS_PRESSURE = 24 +ABS_DISTANCE = 25 +ABS_TILT_X = 26 +ABS_TILT_Y = 27 +ABS_TOOL_WIDTH = 28 +ABS_1D = 29 +ABS_1E = 30 +ABS_1F = 31 +ABS_VOLUME = 32 +ABS_21 = 33 +ABS_22 = 34 +ABS_23 = 35 +ABS_24 = 36 +ABS_25 = 37 +ABS_26 = 38 +ABS_27 = 39 +ABS_MISC = 40 +ABS_29 = 41 +ABS_2A = 42 +ABS_2B = 43 +ABS_2C = 44 +ABS_2D = 45 +ABS_RESERVED = 46 +ABS_MT_SLOT = 47 +ABS_MT_TOUCH_MAJOR = 48 +ABS_MT_TOUCH_MINOR = 49 +ABS_MT_WIDTH_MAJOR = 50 +ABS_MT_WIDTH_MINOR = 51 +ABS_MT_ORIENTATION = 52 +ABS_MT_POSITION_X = 53 +ABS_MT_POSITION_Y = 54 +ABS_MT_TOOL_TYPE = 55 +ABS_MT_BLOB_ID = 56 +ABS_MT_TRACKING_ID = 57 +ABS_MT_PRESSURE = 58 +ABS_MT_DISTANCE = 59 +ABS_MT_TOOL_X = 60 +ABS_MT_TOOL_Y = 61 +ABS_3E = 62 +ABS_MAX = 63 + + +EV_MSC = 4 +MSC_SERIAL = 0 +MSC_PULSELED = 1 +MSC_GESTURE = 2 +MSC_RAW = 3 +MSC_SCAN = 4 +MSC_TIMESTAMP = 5 +MSC_06 = 6 +MSC_MAX = 7 + + +EV_SW = 5 +SW_LID = 0 +SW_TABLET_MODE = 1 +SW_HEADPHONE_INSERT = 2 +SW_RFKILL_ALL = 3 +SW_MICROPHONE_INSERT = 4 +SW_DOCK = 5 +SW_LINEOUT_INSERT = 6 +SW_JACK_PHYSICAL_INSERT = 7 +SW_VIDEOOUT_INSERT = 8 +SW_CAMERA_LENS_COVER = 9 +SW_KEYPAD_SLIDE = 10 +SW_FRONT_PROXIMITY = 11 +SW_ROTATE_LOCK = 12 +SW_LINEIN_INSERT = 13 +SW_MUTE_DEVICE = 14 +SW_PEN_INSERTED = 15 +SW_MACHINE_COVER = 16 + + +EV_LED = 17 +LED_NUML = 0 +LED_CAPSL = 1 +LED_SCROLLL = 2 +LED_COMPOSE = 3 +LED_KANA = 4 +LED_SLEEP = 5 +LED_SUSPEND = 6 +LED_MUTE = 7 +LED_MISC = 8 +LED_MAIL = 9 +LED_CHARGING = 10 +LED_0B = 11 +LED_0C = 12 +LED_0D = 13 +LED_0E = 14 +LED_MAX = 15 + + +EV_SND = 18 +SND_CLICK = 0 +SND_BELL = 1 +SND_TONE = 2 +SND_03 = 3 +SND_04 = 4 +SND_05 = 5 +SND_06 = 6 +SND_MAX = 7 + + +EV_REP = 20 +REP_DELAY = 0 +REP_PERIOD = 1 + + +EV_FF = 21 +FF_STATUS_STOPPED = 0 +FF_STATUS_MAX = 1 +FF_02 = 2 +FF_03 = 3 +FF_04 = 4 +FF_05 = 5 +FF_06 = 6 +FF_07 = 7 +FF_08 = 8 +FF_09 = 9 +FF_0A = 10 +FF_0B = 11 +FF_0C = 12 +FF_0D = 13 +FF_0E = 14 +FF_0F = 15 +FF_10 = 16 +FF_11 = 17 +FF_12 = 18 +FF_13 = 19 +FF_14 = 20 +FF_15 = 21 +FF_16 = 22 +FF_17 = 23 +FF_18 = 24 +FF_19 = 25 +FF_1A = 26 +FF_1B = 27 +FF_1C = 28 +FF_1D = 29 +FF_1E = 30 +FF_1F = 31 +FF_20 = 32 +FF_21 = 33 +FF_22 = 34 +FF_23 = 35 +FF_24 = 36 +FF_25 = 37 +FF_26 = 38 +FF_27 = 39 +FF_28 = 40 +FF_29 = 41 +FF_2A = 42 +FF_2B = 43 +FF_2C = 44 +FF_2D = 45 +FF_2E = 46 +FF_2F = 47 +FF_30 = 48 +FF_31 = 49 +FF_32 = 50 +FF_33 = 51 +FF_34 = 52 +FF_35 = 53 +FF_36 = 54 +FF_37 = 55 +FF_38 = 56 +FF_39 = 57 +FF_3A = 58 +FF_3B = 59 +FF_3C = 60 +FF_3D = 61 +FF_3E = 62 +FF_3F = 63 +FF_40 = 64 +FF_41 = 65 +FF_42 = 66 +FF_43 = 67 +FF_44 = 68 +FF_45 = 69 +FF_46 = 70 +FF_47 = 71 +FF_48 = 72 +FF_49 = 73 +FF_4A = 74 +FF_4B = 75 +FF_4C = 76 +FF_4D = 77 +FF_4E = 78 +FF_4F = 79 +FF_RUMBLE = 80 +FF_PERIODIC = 81 +FF_CONSTANT = 82 +FF_SPRING = 83 +FF_FRICTION = 84 +FF_DAMPER = 85 +FF_INERTIA = 86 +FF_RAMP = 87 +FF_SQUARE = 88 +FF_TRIANGLE = 89 +FF_SINE = 90 +FF_SAW_UP = 91 +FF_SAW_DOWN = 92 +FF_CUSTOM = 93 +FF_5E = 94 +FF_5F = 95 +FF_GAIN = 96 +FF_AUTOCENTER = 97 +FF_62 = 98 +FF_63 = 99 +FF_64 = 100 +FF_65 = 101 +FF_66 = 102 +FF_67 = 103 +FF_68 = 104 +FF_69 = 105 +FF_6A = 106 +FF_6B = 107 +FF_6C = 108 +FF_6D = 109 +FF_6E = 110 +FF_6F = 111 +FF_70 = 112 +FF_71 = 113 +FF_72 = 114 +FF_73 = 115 +FF_74 = 116 +FF_75 = 117 +FF_76 = 118 +FF_77 = 119 +FF_78 = 120 +FF_79 = 121 +FF_7A = 122 +FF_7B = 123 +FF_7C = 124 +FF_7D = 125 +FF_7E = 126 +FF_MAX = 127 + + +EV_PWR = 22 + + +EV_FF_STATUS = 23 + + +EV_MAX = 31 diff --git a/remarkable_mouse/evdev.py b/remarkable_mouse/evdev.py index b5a4fca..08770ce 100644 --- a/remarkable_mouse/evdev.py +++ b/remarkable_mouse/evdev.py @@ -6,8 +6,8 @@ import time from itertools import cycle from socket import timeout as TimeoutError import libevdev -from libevdev import EV_SYN, EV_KEY, EV_ABS +from .codes import EV_SYN, EV_ABS, ABS_X, ABS_Y, SYN_REPORT from .common import get_monitor, remap, wacom_width, wacom_height logging.basicConfig(format='%(message)s') @@ -113,17 +113,17 @@ def read_tablet(rm_inputs, *, orientation, monitor_num, region, threshold, mode) local_device.send_events([e]) - if e.matches(EV_ABS): + if e_type == EV_ABS: # handle x direction - if e.matches(EV_ABS.ABS_Y): - x = e.value + if e_code == ABS_Y: + x = e_value # handle y direction - if e.matches(EV_ABS.ABS_X): - y = e.value + if e_code == ABS_X: + y = e_value - elif e.matches(EV_SYN): + elif e_type == EV_SYN: mapped_x, mapped_y = remap( x, y, wacom_width, wacom_height, @@ -131,22 +131,23 @@ def read_tablet(rm_inputs, *, orientation, monitor_num, region, threshold, mode) mode, orientation ) local_device.send_events([e]) + print('sent') + print(e_type) else: local_device.send_events([e]) # While debug mode is active, we log events grouped together between # SYN_REPORT events. Pending events for the next log are stored here - if log.level == logging.DEBUG: - if e_bit == libevdev.EV_SYN.SYN_REPORT: - event_repr = ', '.join( - '{} = {}'.format( - e.code.name, - e.value - ) for event in pending_events - ) - log.debug('{}.{:0>6} - {}'.format(e_time, e_millis, event_repr)) - pending_events = [] - else: - pending_events.append(event) - + # if log.level == logging.DEBUG: + # if e_bit == SYN_REPORT: + # event_repr = ', '.join( + # '{} = {}'.format( + # e.code.name, + # e.value + # ) for event in pending_events + # ) + # log.debug('{}.{:0>6} - {}'.format(e_time, e_millis, event_repr)) + # pending_events = [] + # else: + # pending_events.append(event) diff --git a/remarkable_mouse/generate_codes.py b/remarkable_mouse/generate_codes.py new file mode 100644 index 0000000..e71febb --- /dev/null +++ b/remarkable_mouse/generate_codes.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +# Generate file of evdev codes from libevdev that is importable on OSX/Windows. +# Only runs on Linux. + +import libevdev + +with open('codes.py' , 'w') as f: + for t in libevdev.types: + f.write(f'\n\n{t.name} = {t.value}\n') + for c in t.codes: + f.write(f'{c.name} = {c.value}\n') diff --git a/remarkable_mouse/pynput.py b/remarkable_mouse/pynput.py index 9dc9b90..d01863a 100644 --- a/remarkable_mouse/pynput.py +++ b/remarkable_mouse/pynput.py @@ -1,9 +1,8 @@ import logging import struct from screeninfo import get_monitors -import libevdev -from libevdev import EV_SYN, EV_KEY, EV_ABS +from .codes import EV_SYN, EV_ABS, ABS_X, ABS_Y, BTN_TOUCH from .common import get_monitor, remap, wacom_width, wacom_height logging.basicConfig(format='%(message)s') @@ -39,32 +38,29 @@ def read_tablet(rm_inputs, *, orientation, monitor_num, region, threshold, mode) while True: _, _, e_type, e_code, e_value = struct.unpack('2IHHi', rm_inputs['pen'].read(16)) - e_bit = libevdev.evbit(e_type, e_code) - e = libevdev.InputEvent(e_bit, value=e_value) - - if e.matches(EV_ABS): + if e_type == EV_ABS: # handle x direction - if e.matches(EV_ABS.ABS_Y): - log.debug(e.value) - x = e.value + if e_code == ABS_Y: + log.debug(e_value) + x = e_value # handle y direction - if e.matches(EV_ABS.ABS_X): - log.debug('\t{}'.format(e.value)) - y = e.value + if e_code == ABS_X: + log.debug('\t{}'.format(e_value)) + y = e_value # handle draw - if e.matches(EV_KEY.BTN_TOUCH): - log.debug('\t\t{}'.format(e.value)) - if e.value == 1: + if e_code == BTN_TOUCH: + log.debug('\t\t{}'.format(e_value)) + if e_value == 1: log.debug('PRESS') mouse.press(Button.left) else: log.debug('RELEASE') mouse.release(Button.left) - if e.matches(EV_SYN): + if e_type == EV_SYN: mapped_x, mapped_y = remap( x, y, wacom_width, wacom_height,