From da6b29f138f7dc6e35480251b9d0aa9d0cfe2cd5 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Mon, 14 Feb 2022 21:13:42 +0100 Subject: [PATCH] autocommit 2022-02-14 21:13:42 CET --- Cargo.lock | 111 +- Cargo.toml | 6 + default-config/Cargo.toml | 11 + default-config/src/keymap.xkb | 313 ++ default-config/src/lib.rs | 43 + i4config/Cargo.toml | 8 + i4config/src/_private.rs | 39 + i4config/src/_private/client.rs | 323 +++ i4config/src/_private/ipc.rs | 96 + i4config/src/_private/logging.rs | 39 + i4config/src/keyboard/keymap.rs | 18 + i4config/src/keyboard/mod.rs | 40 + i4config/src/keyboard/mods.rs | 60 + i4config/src/keyboard/syms.rs | 2556 +++++++++++++++++ i4config/src/lib.rs | 131 + i4config/src/macros.rs | 68 + src/backend.rs | 27 +- src/backends/{xorg/mod.rs => xorg.rs} | 96 +- src/config.rs | 154 + src/config/handler.rs | 370 +++ src/ifs/wl_seat.rs | 161 +- src/ifs/wl_seat/event_handling.rs | 116 +- src/ifs/wl_seat/wl_keyboard.rs | 32 +- src/ifs/wl_surface.rs | 29 +- src/ifs/wl_surface/xdg_surface.rs | 17 +- .../wl_surface/xdg_surface/xdg_toplevel.rs | 16 +- src/keycodes.xkb | 485 ++++ src/keymap.xkb | 285 ++ src/leaks.rs | 51 +- src/macros.rs | 5 + src/main.rs | 35 +- src/render/gl/program.rs | 2 +- src/render/gl/shader.rs | 3 +- src/state.rs | 36 +- src/tasks/backend.rs | 27 +- src/tasks/device.rs | 157 + src/tasks/mod.rs | 2 +- src/tasks/seat.rs | 60 - src/tree/container.rs | 51 +- src/tree/mod.rs | 23 +- src/utils/linkedlist.rs | 21 +- src/utils/mod.rs | 1 + src/utils/stack.rs | 28 + src/xkbcommon/mod.rs | 115 +- 44 files changed, 5903 insertions(+), 364 deletions(-) create mode 100644 default-config/Cargo.toml create mode 100644 default-config/src/keymap.xkb create mode 100644 default-config/src/lib.rs create mode 100644 i4config/Cargo.toml create mode 100644 i4config/src/_private.rs create mode 100644 i4config/src/_private/client.rs create mode 100644 i4config/src/_private/ipc.rs create mode 100644 i4config/src/_private/logging.rs create mode 100644 i4config/src/keyboard/keymap.rs create mode 100644 i4config/src/keyboard/mod.rs create mode 100644 i4config/src/keyboard/mods.rs create mode 100644 i4config/src/keyboard/syms.rs create mode 100644 i4config/src/lib.rs create mode 100644 i4config/src/macros.rs rename src/backends/{xorg/mod.rs => xorg.rs} (93%) create mode 100644 src/config.rs create mode 100644 src/config/handler.rs create mode 100644 src/keycodes.xkb create mode 100644 src/keymap.xkb create mode 100644 src/tasks/device.rs delete mode 100644 src/tasks/seat.rs create mode 100644 src/utils/stack.rs diff --git a/Cargo.lock b/Cargo.lock index aa4408ef..02cf30c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.52" +version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3" +checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" [[package]] name = "atty" @@ -56,9 +56,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" @@ -75,6 +75,24 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bincode" +version = "2.0.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3b09eea9771bcc3c1d3f21325c51066859dbb9addfad6325273630d9ea1707d" +dependencies = [ + "bincode_derive", +] + +[[package]] +name = "bincode_derive" +version = "2.0.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebde72585aa64e130b4c1d3612742253e7c486f25cb299b4373e505130519279" +dependencies = [ + "virtue", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -129,6 +147,14 @@ dependencies = [ "winapi", ] +[[package]] +name = "default-config" +version = "0.1.0" +dependencies = [ + "i4config", + "log", +] + [[package]] name = "env_logger" version = "0.9.0" @@ -153,9 +179,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", @@ -168,9 +194,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -178,15 +204,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-executor" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ "futures-core", "futures-task", @@ -195,15 +221,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-macro" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2", "quote", @@ -212,21 +238,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ "futures-channel", "futures-core", @@ -242,9 +268,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", "libc", @@ -279,12 +305,15 @@ dependencies = [ "ahash", "anyhow", "backtrace", + "bincode", "bitflags", "bstr", "byteorder", "chrono", + "default-config", "env_logger", "futures", + "i4config", "isnt", "libloading", "log", @@ -301,6 +330,14 @@ dependencies = [ "xcb-dl-util", ] +[[package]] +name = "i4config" +version = "0.1.0" +dependencies = [ + "bincode", + "log", +] + [[package]] name = "isnt" version = "0.1.0" @@ -315,15 +352,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.112" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" +checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" [[package]] name = "libloading" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ "cfg-if 1.0.0", "winapi", @@ -401,9 +438,9 @@ checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "pin-utils" @@ -428,9 +465,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2", ] @@ -554,9 +591,9 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "syn" -version = "1.0.84" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb2e6da8ee5eb9a61068762a32fa9619cc591ceb055b3687f4cd4051ec2e06b" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", @@ -641,6 +678,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "virtue" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0e85ed1066abcc0ea331cce3ce83cccf30ae9900529ca46f353b22ca79b56b8" + [[package]] name = "wasi" version = "0.10.0+wasi-snapshot-preview1" diff --git a/Cargo.toml b/Cargo.toml index 42891c19..0279ccc5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" edition = "2021" build = "build/build.rs" +[workspace] +members = ["i4config", "default-config"] + [profile.release] panic = "abort" @@ -33,6 +36,9 @@ smallvec = { version = "1.8.0", features = ["const_generics", "const_new", "unio backtrace = "0.3.64" byteorder = "1.4.3" chrono = "0.4.19" +bincode = "2.0.0-beta.2" +i4config = { path = "i4config" } +default-config = { path = "default-config" } [build-dependencies] repc = "0.1.1" diff --git a/default-config/Cargo.toml b/default-config/Cargo.toml new file mode 100644 index 00000000..13b24665 --- /dev/null +++ b/default-config/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "default-config" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["lib", "cdylib"] + +[dependencies] +i4config = { path = "../i4config" } +log = "0.4.14" diff --git a/default-config/src/keymap.xkb b/default-config/src/keymap.xkb new file mode 100644 index 00000000..5f4d8708 --- /dev/null +++ b/default-config/src/keymap.xkb @@ -0,0 +1,313 @@ +xkb_keymap { + + xkb_keycodes { + + <1> = 9; # ESC + <2> = 10; # 1 + <3> = 11; # 2 + <4> = 12; # 3 + <5> = 13; # 4 + <6> = 14; # 5 + <7> = 15; # 6 + <8> = 16; # 7 + <9> = 17; # 8 + <10> = 18; # 9 + <11> = 19; # 0 + <12> = 20; # MINUS + <13> = 21; # EQUAL + <14> = 22; # BACKSPACE + <15> = 23; # TAB + <16> = 24; # Q + <17> = 25; # W + <18> = 26; # E + <19> = 27; # R + <20> = 28; # T + <21> = 29; # Y + <22> = 30; # U + <23> = 31; # I + <24> = 32; # O + <25> = 33; # P + <26> = 34; # LEFTBRACE + <27> = 35; # RIGHTBRACE + <28> = 36; # ENTER + <29> = 37; # LEFTCTRL + <30> = 38; # A + <31> = 39; # S + <32> = 40; # D + <33> = 41; # F + <34> = 42; # G + <35> = 43; # H + <36> = 44; # J + <37> = 45; # K + <38> = 46; # L + <39> = 47; # SEMICOLON + <40> = 48; # APOSTROPHE + <41> = 49; # GRAVE + <42> = 50; # LEFTSHIFT + <43> = 51; # BACKSLASH + <44> = 52; # Z + <45> = 53; # X + <46> = 54; # C + <47> = 55; # V + <48> = 56; # B + <49> = 57; # N + <50> = 58; # M + <51> = 59; # COMMA + <52> = 60; # DOT + <53> = 61; # SLASH + <54> = 62; # RIGHTSHIFT + <55> = 63; # KPASTERISK + <56> = 64; # LEFTALT + <57> = 65; # SPACE + <58> = 66; # CAPSLOCK + <59> = 67; # F1 + <60> = 68; # F2 + <61> = 69; # F3 + <62> = 70; # F4 + <63> = 71; # F5 + <64> = 72; # F6 + <65> = 73; # F7 + <66> = 74; # F8 + <67> = 75; # F9 + <68> = 76; # F10 + <69> = 77; # NUMLOCK + <70> = 78; # SCROLLLOCK + <71> = 79; # KP7 + <72> = 80; # KP8 + <73> = 81; # KP9 + <74> = 82; # KPMINUS + <75> = 83; # KP4 + <76> = 84; # KP5 + <77> = 85; # KP6 + <78> = 86; # KPPLUS + <79> = 87; # KP1 + <80> = 88; # KP2 + <81> = 89; # KP3 + <82> = 90; # KP0 + <83> = 91; # KPDOT + <87> = 95; # F11 + <88> = 96; # F12 + <89> = 97; # RO + <92> = 100; # HENKAN + <93> = 101; # KATAKANAHIRAGANA + <94> = 102; # MUHENKAN + <96> = 104; # KPENTER + <97> = 105; # RIGHTCTRL + <98> = 106; # KPSLASH + <100> = 108; # RIGHTALT + <102> = 110; # HOME + <103> = 111; # UP + <104> = 112; # PAGEUP + <105> = 113; # LEFT + <106> = 114; # RIGHT + <107> = 115; # END + <108> = 116; # DOWN + <109> = 117; # PAGEDOWN + <110> = 118; # INSERT + <111> = 119; # DELETE + <117> = 125; # KPEQUAL + <119> = 127; # PAUSE + <124> = 132; # YEN + <125> = 133; # LEFTMETA + <126> = 134; # RIGHTMETA + <139> = 147; # MENU + <183> = 191; # F13 + <184> = 192; # F14 + <185> = 193; # F15 + <186> = 194; # F16 + <187> = 195; # F17 + <188> = 196; # F18 + <189> = 197; # F19 + <190> = 198; # F20 + <191> = 199; # F21 + <210> = 218; # PRINT + + # We must include at least one indicator here. Otherwise Xwayland segfaults. + indicator 1 = "DUMMY"; + }; + + xkb_types { + + # We must include at least one virtual modifier. + # Otherwise Xwayland rejects our keymap. + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = none; + }; + type "TWO_LEVEL" { + modifiers = Shift; + map[Shift] = Level2; + }; + type "ALPHABETIC" { + modifiers = Shift+Lock; + map[Shift] = Level2; + map[Lock] = Level2; + }; + type "KEYPAD" { + modifiers = Shift+Mod2; + map[Mod2] = Level2; + }; + }; + + xkb_compatibility { + + interpret.repeat = False; + interpret.locking = False; + interpret Shift_L { + action = SetMods(modifiers=Shift); + }; + interpret Shift_R { + action = SetMods(modifiers=Shift); + }; + interpret Caps_Lock { + action = LockMods(modifiers=Lock); + }; + interpret Control_L { + action = SetMods(modifiers=Control); + }; + interpret Control_R { + action = SetMods(modifiers=Control); + }; + interpret Alt_L { + action = SetMods(modifiers=Mod1); + }; + interpret Alt_R { + action = SetMods(modifiers=Mod1); + }; + interpret Num_Lock { + action = LockMods(modifiers=Mod2); + }; + }; + + xkb_symbols { + + key <1> { [ Escape ] }; + key <59> { [ F1 ] }; + key <60> { [ F2 ] }; + key <61> { [ F3 ] }; + key <62> { [ F4 ] }; + key <63> { [ F5 ] }; + key <64> { [ F6 ] }; + key <65> { [ F7 ] }; + key <66> { [ F8 ] }; + key <67> { [ F9 ] }; + key <68> { [ F10 ] }; + key <87> { [ F11 ] }; + key <88> { [ F12 ] }; + key <183> { [ F13 ] }; + key <184> { [ F14 ] }; + key <185> { [ F15 ] }; + key <186> { [ F16 ] }; + key <187> { [ F17 ] }; + key <188> { [ F18 ] }; + key <189> { [ F19 ] }; + key <190> { [ F20 ] }; + key <191> { [ F21 ] }; + key <210> { [ Print ] }; + key <70> { [ Scroll_Lock ] }; + key <119> { [ Pause ] }; + + key <69> { [ Num_Lock ] }; + key <96> { [ KP_Enter ] }; + key <98> { [ KP_Divide ] }; + key <74> { [ KP_Subtract ] }; + key <55> { [ KP_Multiply ] }; + key <78> { [ KP_Add ] }; + key <117> { [ KP_Equal ] }; + key <83> { [ KP_Delete, KP_Decimal ] }; + key <71> { [ KP_Home, KP_7 ] }; + key <72> { [ KP_Up, KP_8 ] }; + key <73> { [ KP_Prior, KP_9 ] }; + key <75> { [ KP_Left, KP_4 ] }; + key <76> { [ KP_Begin, KP_5 ] }; + key <77> { [ KP_Right, KP_6 ] }; + key <79> { [ KP_End, KP_1 ] }; + key <80> { [ KP_Down, KP_2 ] }; + key <81> { [ KP_Next, KP_3 ] }; + key <82> { [ KP_Insert, KP_0 ] }; + + key <103> { [ Up ] }; + key <105> { [ Left ] }; + key <106> { [ Right ] }; + key <108> { [ Down ] }; + + key <102> { [ Home ] }; + key <104> { [ Prior ] }; + key <107> { [ End ] }; + key <109> { [ Next ] }; + key <110> { [ Insert ] }; + key <111> { [ Delete ] }; + + key <14> { [ BackSpace ] }; + key <15> { [ Tab, ISO_Left_Tab ] }; + key <58> { [ Caps_Lock ] }; + key <28> { [ Return ] }; + key <42> { [ Shift_L ] }; + key <54> { [ Shift_R ] }; + key <29> { [ Control_L ] }; + key <125> { [ Super_L ] }; + key <56> { [ Alt_L ] }; + key <57> { [ space ] }; + key <100> { [ Alt_R ] }; + key <126> { [ Super_R ] }; + key <139> { [ Menu ] }; + key <97> { [ Control_R ] }; + + key <41> { [ grave, asciitilde ] }; + key <12> { [ minus, underscore ] }; + key <13> { [ equal, plus ] }; + key <26> { [ bracketleft, braceleft ] }; + key <27> { [ bracketright, braceright ] }; + key <43> { [ backslash, bar ] }; + key <39> { [ semicolon, colon ] }; + key <40> { [ apostrophe, quotedbl ] }; + key <51> { [ comma, less ] }; + key <52> { [ period, greater ] }; + key <53> { [ slash, question ] }; + key <89> { [ dollar, asciitilde ] }; + key <93> { [ ampersand, percent ] }; + key <94> { [ equal, asterisk ] }; + key <124> { [ at, asciicircum ] }; + key <92> { [ numbersign, grave ] }; + + key <16> { [ q, Q ] }; + key <17> { [ w, W ] }; + key <18> { [ e, E ] }; + key <19> { [ r, R ] }; + key <20> { [ t, T ] }; + key <21> { [ y, Y ] }; + key <22> { [ u, U ] }; + key <23> { [ i, I ] }; + key <24> { [ o, O ] }; + key <25> { [ p, P ] }; + key <30> { [ a, A ] }; + key <31> { [ s, S ] }; + key <32> { [ d, D ] }; + key <33> { [ f, F ] }; + key <34> { [ g, G ] }; + key <35> { [ h, H ] }; + key <36> { [ j, J ] }; + key <37> { [ k, K ] }; + key <38> { [ l, L ] }; + key <44> { [ z, Z ] }; + key <45> { [ x, X ] }; + key <46> { [ c, C ] }; + key <47> { [ v, V ] }; + key <48> { [ b, B ] }; + key <49> { [ n, N ] }; + key <50> { [ m, M ] }; + + key <2> { [ 1, exclam ] }; + key <3> { [ 2, at ] }; + key <4> { [ 3, numbersign ] }; + key <5> { [ 4, dollar ] }; + key <6> { [ 5, percent ] }; + key <7> { [ 6, asciicircum ] }; + key <8> { [ 7, ampersand ] }; + key <9> { [ 8, asterisk ] }; + key <10> { [ 9, parenleft ] }; + key <11> { [ 0, parenright ] }; + }; + +}; diff --git a/default-config/src/lib.rs b/default-config/src/lib.rs new file mode 100644 index 00000000..6051b48c --- /dev/null +++ b/default-config/src/lib.rs @@ -0,0 +1,43 @@ +use i4config::keyboard::mods::{ALT, CTRL, Modifiers, SHIFT}; +use i4config::keyboard::syms::{SYM_Super_L, SYM_h, SYM_j, SYM_k, SYM_l, SYM_plus, SYM_minus, SYM_r}; +use i4config::Direction::{Down, Left, Right, Up}; +use i4config::{config, shell, Seat, create_seat, input_devices, on_new_input_device}; + +const MOD: Modifiers = ALT; + +fn configure_seat(s: Seat) { + log::info!("Configuring seat {:?}", s); + + let change_rate = move |delta| { + let (rate, delay) = s.repeat_rate(); + let new_rate = rate - delta; + let new_delay = delay + 10 * delta; + s.set_repeat_rate(new_rate, new_delay); + }; + + s.bind(CTRL | SYM_l, move || change_rate(-1)); + s.bind(CTRL | SYM_r, move || change_rate(1)); + + s.bind(CTRL | SYM_h, move || s.focus(Left)); + s.bind(CTRL | SYM_j, move || s.focus(Down)); + s.bind(CTRL | SYM_k, move || s.focus(Up)); + s.bind(CTRL | SYM_l, move || s.focus(Right)); + + s.bind(MOD | SHIFT | SYM_h, move || s.move_(Left)); + s.bind(MOD | SHIFT | SYM_j, move || s.move_(Down)); + s.bind(MOD | SHIFT | SYM_k, move || s.move_(Up)); + s.bind(MOD | SHIFT | SYM_l, move || s.move_(Right)); + + s.bind(SYM_Super_L, || shell("alacritty")); +} + +pub fn configure() { + let seat = create_seat("default"); + configure_seat(seat); + for device in input_devices() { + device.set_seat(seat); + } + on_new_input_device(move |device| device.set_seat(seat)); +} + +config!(configure); diff --git a/i4config/Cargo.toml b/i4config/Cargo.toml new file mode 100644 index 00000000..3a51bc4b --- /dev/null +++ b/i4config/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "i4config" +version = "0.1.0" +edition = "2021" + +[dependencies] +bincode = "2.0.0-beta.2" +log = "0.4.14" diff --git a/i4config/src/_private.rs b/i4config/src/_private.rs new file mode 100644 index 00000000..d39e9674 --- /dev/null +++ b/i4config/src/_private.rs @@ -0,0 +1,39 @@ +pub mod client; +pub mod ipc; +mod logging; + +use std::marker::PhantomData; + +pub const VERSION: u32 = 1; + +#[repr(C)] +pub struct ConfigEntry { + pub version: u32, + pub init: unsafe extern "C" fn( + srv_data: *const u8, + srv_unref: unsafe extern "C" fn(data: *const u8), + srv_handler: unsafe extern "C" fn(data: *const u8, msg: *const u8, size: usize), + msg: *const u8, + size: usize, + ) -> *const u8, + pub unref: unsafe extern "C" fn(data: *const u8), + pub handle_msg: unsafe extern "C" fn(data: *const u8, msg: *const u8, size: usize), +} + +pub struct ConfigEntryGen { + _phantom: PhantomData, +} + +impl ConfigEntryGen {} + +pub fn bincode_ops() -> impl bincode::config::Config { + bincode::config::standard() + .with_fixed_int_encoding() + .with_little_endian() + .with_no_limit() + .skip_fixed_array_length() +} + +pub trait Config { + extern "C" fn configure(); +} diff --git a/i4config/src/_private/client.rs b/i4config/src/_private/client.rs new file mode 100644 index 00000000..3fde047a --- /dev/null +++ b/i4config/src/_private/client.rs @@ -0,0 +1,323 @@ +use crate::_private::ipc::{InitMessage, Request, Response}; +use crate::_private::{bincode_ops, logging, Config, ConfigEntry, ConfigEntryGen, VERSION}; +use crate::{Direction, InputDevice, LogLevel, ModifiedKeySym, Seat}; +use std::cell::{Cell, RefCell}; +use std::collections::hash_map::Entry; +use std::collections::HashMap; +use std::ops::Deref; +use std::rc::Rc; +use std::{ptr, slice}; +use crate::keyboard::keymap::Keymap; + +pub(crate) struct Client { + configure: extern "C" fn(), + srv_data: *const u8, + srv_unref: unsafe extern "C" fn(data: *const u8), + srv_handler: unsafe extern "C" fn(data: *const u8, msg: *const u8, size: usize), + key_handlers: RefCell>>, + response: RefCell>, + on_new_seat: RefCell>>, + on_new_input_device: RefCell>>, + bufs: RefCell>>, +} + +impl Drop for Client { + fn drop(&mut self) { + unsafe { + (self.srv_unref)(self.srv_data); + } + } +} + +thread_local! { + pub(crate) static CLIENT: std::cell::Cell<*const Client> = const { std::cell::Cell::new(ptr::null()) }; +} + +unsafe fn with_client T>(data: *const u8, f: F) -> T { + struct Reset<'a> { + cell: &'a Cell<*const Client>, + val: *const Client, + } + impl Drop for Reset<'_> { + fn drop(&mut self) { + self.cell.set(self.val); + } + } + CLIENT.with(|cell| unsafe { + let client = data as *const Client; + Rc::increment_strong_count(client); + let client = Rc::from_raw(client); + let old = cell.replace(client.deref()); + let _reset = Reset { cell, val: old }; + f(&client) + }) +} + +impl ConfigEntryGen { + pub const ENTRY: ConfigEntry = ConfigEntry { + version: VERSION, + init: Self::init, + unref, + handle_msg, + }; + + pub unsafe extern "C" fn init( + srv_data: *const u8, + srv_unref: unsafe extern "C" fn(data: *const u8), + srv_handler: unsafe extern "C" fn(data: *const u8, msg: *const u8, size: usize), + init_data: *const u8, + size: usize, + ) -> *const u8 { + logging::init(); + init( + srv_data, + srv_unref, + srv_handler, + init_data, + size, + T::configure, + ) + } +} + +pub unsafe extern "C" fn init( + srv_data: *const u8, + srv_unref: unsafe extern "C" fn(data: *const u8), + srv_handler: unsafe extern "C" fn(data: *const u8, msg: *const u8, size: usize), + init: *const u8, + size: usize, + f: extern "C" fn(), +) -> *const u8 { + let client = Rc::new(Client { + configure: f, + srv_data, + srv_unref, + srv_handler, + key_handlers: Default::default(), + response: Default::default(), + on_new_seat: Default::default(), + on_new_input_device: Default::default(), + bufs: Default::default(), + }); + let init = slice::from_raw_parts(init, size); + client.handle_init_msg(init); + Rc::into_raw(client) as *const u8 +} + +pub unsafe extern "C" fn unref(data: *const u8) { + let client = data as *const Client; + drop(Rc::from_raw(client)); +} + +pub unsafe extern "C" fn handle_msg(data: *const u8, msg: *const u8, size: usize) { + with_client(data, |client| { + let msg = slice::from_raw_parts(msg, size); + client.handle_msg(msg); + }); +} + +impl Client { + fn send(&self, msg: &Request) { + let mut buf = self.bufs.borrow_mut().pop().unwrap_or_default(); + buf.clear(); + bincode::encode_into_std_write(msg, &mut buf, bincode_ops()).unwrap(); + unsafe { + (self.srv_handler)(self.srv_data, buf.as_ptr(), buf.len()); + } + self.bufs.borrow_mut().push(buf); + } + + pub fn shell(&self, shell: &str) { + self.send(&Request::Shell { script: shell }); + } + + pub fn focus(&self, seat: Seat, direction: Direction) { + self.send(&Request::Focus { seat, direction }); + } + + pub fn move_(&self, seat: Seat, direction: Direction) { + self.send(&Request::Move { seat, direction }); + } + + pub fn unbind>(&self, seat: Seat, mod_sym: T) { + let mod_sym = mod_sym.into(); + let deregister = self + .key_handlers + .borrow_mut() + .remove(&(seat, mod_sym)) + .is_some(); + if deregister { + self.send(&Request::RemoveShortcut { + seat, + mods: mod_sym.mods, + sym: mod_sym.sym, + }) + } + } + + fn with_response(&self, f: F) -> Response { + f(); + self.response.borrow_mut().pop().unwrap_or(Response::None) + } + + pub fn seats(&self) -> Vec { + let response = self.with_response(|| self.send(&Request::GetSeats)); + match response { + Response::GetSeats { seats } => seats, + _ => { + log::error!("Server did not send a response to a get_seats request"); + vec![] + } + } + } + + pub fn create_seat(&self, name: &str) -> Seat { + let response = self.with_response(|| self.send(&Request::CreateSeat { name })); + match response { + Response::CreateSeat { seat } => seat, + _ => { + log::error!("Server did not send a response to a create_seat request"); + Seat(0) + } + } + } + + pub fn get_input_devices(&self) -> Vec { + let res = self.with_response(|| self.send(&Request::GetInputDevices)); + match res { + Response::GetInputDevices { devices } => devices, + _ => { + log::error!("Server did not send a response to a get_input_devices request"); + vec!() + } + } + } + + pub fn on_new_seat(&self, f: F) { + *self.on_new_seat.borrow_mut() = Some(Rc::new(f)); + } + + pub fn on_new_input_device(&self, f: F) { + *self.on_new_input_device.borrow_mut() = Some(Rc::new(f)); + } + + pub fn set_seat(&self, device: InputDevice, seat: Seat) { + self.send(&Request::SetSeat { device, seat }) + } + + pub fn seat_set_keymap(&self, seat: Seat, keymap: Keymap) { + self.send(&Request::SeatSetKeymap { seat, keymap }) + } + + pub fn seat_set_repeat_rate(&self, seat: Seat, rate: i32, delay: i32) { + self.send(&Request::SeatSetRepeatRate { seat, rate, delay }) + } + + pub fn seat_get_repeat_rate(&self, seat: Seat) -> (i32, i32) { + let res = self.with_response(|| self.send(&Request::SeatGetRepeatRate { seat })); + match res { + Response::GetRepeatRate { rate, delay } => (rate, delay), + _ => { + log::error!("Server did not send a response to a get_repeat_rate request"); + (25, 250) + } + } + } + + pub fn parse_keymap(&self, keymap: &str) -> Keymap { + let res = self.with_response(|| self.send(&Request::ParseKeymap { keymap })); + match res { + Response::ParseKeymap { keymap } => keymap, + _ => { + log::error!("Server did not send a response to a parse_keymap request"); + Keymap(0) + } + } + } + + pub fn bind, F: Fn() + 'static>(&self, seat: Seat, mod_sym: T, f: F) { + let mod_sym = mod_sym.into(); + let register = { + let mut kh = self.key_handlers.borrow_mut(); + let f = Rc::new(f); + match kh.entry((seat, mod_sym)) { + Entry::Occupied(mut o) => { + *o.get_mut() = f; + false + } + Entry::Vacant(v) => { + v.insert(f); + true + } + } + }; + if register { + self.send(&Request::AddShortcut { + seat, + mods: mod_sym.mods, + sym: mod_sym.sym, + }); + } + } + + pub fn log(&self, level: LogLevel, msg: &str, file: Option<&str>, line: Option) { + self.send(&Request::Log { + level, + msg, + file, + line, + }) + } + + fn handle_msg(&self, msg: &[u8]) { + let res = bincode::decode_from_slice::(msg, bincode_ops()); + let (msg, _) = match res { + Ok(msg) => msg, + Err(e) => { + let msg = format!("could not deserialize message: {}", e); + self.log(LogLevel::Error, &msg, None, None); + return; + } + }; + match msg { + Request::Configure => { + (self.configure)(); + } + Request::Response { response } => { + self.response.borrow_mut().push(response); + } + Request::InvokeShortcut { seat, mods, sym } => { + let ms = ModifiedKeySym { mods, sym }; + let handler = self.key_handlers.borrow_mut().get(&(seat, ms)).cloned(); + if let Some(handler) = handler { + handler(); + } + } + Request::NewInputDevice { device } => { + let handler = self.on_new_input_device.borrow_mut().clone(); + if let Some(handler) = handler { + handler(device); + } + } + m => { + let err = format!("unexpected message: {:?}", m); + self.log(LogLevel::Error, &err, None, None); + return; + } + } + } + + fn handle_init_msg(&self, msg: &[u8]) { + let (init, _) = match bincode::decode_from_slice::(msg, bincode_ops()) { + Ok(m) => m, + Err(e) => { + let msg = format!("could not deserialize message: {}", e); + self.log(LogLevel::Error, &msg, None, None); + return; + } + }; + match init { + InitMessage::V1(_) => {} + } + } +} diff --git a/i4config/src/_private/ipc.rs b/i4config/src/_private/ipc.rs new file mode 100644 index 00000000..0523abaa --- /dev/null +++ b/i4config/src/_private/ipc.rs @@ -0,0 +1,96 @@ +use crate::keyboard::mods::Modifiers; +use crate::keyboard::syms::KeySym; +use crate::{Direction, InputDevice, LogLevel, Seat}; +use bincode::{BorrowDecode, Decode, Encode}; +use crate::keyboard::keymap::Keymap; + +#[derive(Encode, BorrowDecode, Debug)] +pub enum Request<'a> { + Configure, + Log { + level: LogLevel, + msg: &'a str, + file: Option<&'a str>, + line: Option, + }, + Response { + response: Response, + }, + CreateSeat { + name: &'a str, + }, + SetSeat { + device: InputDevice, + seat: Seat, + }, + ParseKeymap { + keymap: &'a str, + }, + SeatSetKeymap { + seat: Seat, + keymap: Keymap, + }, + SeatGetRepeatRate { + seat: Seat, + }, + SeatSetRepeatRate { + seat: Seat, + rate: i32, + delay: i32, + }, + RemoveSeat { + seat: Seat, + }, + GetSeats, + GetInputDevices, + NewInputDevice { + device: InputDevice, + }, + DelInputDevice { + device: InputDevice, + }, + AddShortcut { + seat: Seat, + mods: Modifiers, + sym: KeySym, + }, + RemoveShortcut { + seat: Seat, + mods: Modifiers, + sym: KeySym, + }, + InvokeShortcut { + seat: Seat, + mods: Modifiers, + sym: KeySym, + }, + Shell { + script: &'a str, + }, + Focus { + seat: Seat, + direction: Direction, + }, + Move { + seat: Seat, + direction: Direction, + }, +} + +#[derive(Encode, Decode, Debug)] +pub enum Response { + None, + GetSeats { seats: Vec }, + GetRepeatRate { rate: i32, delay: i32 }, + ParseKeymap { keymap: Keymap, }, + CreateSeat { seat: Seat }, + GetInputDevices { devices: Vec }, +} + +#[derive(Encode, Decode, Debug)] +pub enum InitMessage { + V1(V1InitMessage), +} + +#[derive(Encode, Decode, Debug)] +pub struct V1InitMessage {} diff --git a/i4config/src/_private/logging.rs b/i4config/src/_private/logging.rs new file mode 100644 index 00000000..e486c46c --- /dev/null +++ b/i4config/src/_private/logging.rs @@ -0,0 +1,39 @@ +use crate::LogLevel; +use log::{Level, LevelFilter, Log, Metadata, Record}; + +pub fn init() { + log::set_logger(&Logger).unwrap(); + log::set_max_level(LevelFilter::Trace); +} + +struct Logger; + +impl Log for Logger { + fn enabled(&self, _metadata: &Metadata) -> bool { + true + } + + fn log(&self, record: &Record) { + let client = get!(); + let level = match record.level() { + Level::Error => LogLevel::Error, + Level::Warn => LogLevel::Warn, + Level::Info => LogLevel::Info, + Level::Debug => LogLevel::Debug, + Level::Trace => LogLevel::Trace, + }; + let formatted; + let msg = match record.args().as_str() { + Some(s) => s, + _ => { + formatted = record.args().to_string(); + &formatted + } + }; + client.log(level, msg, record.file(), record.line()); + } + + fn flush(&self) { + // nothing + } +} diff --git a/i4config/src/keyboard/keymap.rs b/i4config/src/keyboard/keymap.rs new file mode 100644 index 00000000..30eea475 --- /dev/null +++ b/i4config/src/keyboard/keymap.rs @@ -0,0 +1,18 @@ +use bincode::{Decode, Encode}; + +#[derive(Encode, Decode, Copy, Clone, Debug, Eq, PartialEq, Hash)] +pub struct Keymap(pub u64); + +impl Keymap { + pub const INVALID: Self = Self(0); + + pub fn is_invalid(self) -> bool { + self == Self::INVALID + } + + pub fn parse(self, keymap: &str) -> Self { + let mut res = Self::INVALID; + (|| res = get!().parse_keymap(keymap))(); + res + } +} diff --git a/i4config/src/keyboard/mod.rs b/i4config/src/keyboard/mod.rs new file mode 100644 index 00000000..bd614e54 --- /dev/null +++ b/i4config/src/keyboard/mod.rs @@ -0,0 +1,40 @@ +use crate::keyboard::mods::Modifiers; +use crate::keyboard::syms::KeySym; +use bincode::{Decode, Encode}; +use std::ops::{BitOr, BitOrAssign}; + +pub mod mods; +pub mod syms; +pub mod keymap; + +#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, Hash)] +pub struct ModifiedKeySym { + pub mods: Modifiers, + pub sym: KeySym, +} + +impl From for ModifiedKeySym { + fn from(sym: KeySym) -> Self { + Self { + mods: Modifiers(0), + sym, + } + } +} + +impl BitOr for ModifiedKeySym { + type Output = ModifiedKeySym; + + fn bitor(self, rhs: Modifiers) -> Self::Output { + ModifiedKeySym { + mods: self.mods | rhs, + sym: self.sym, + } + } +} + +impl BitOrAssign for ModifiedKeySym { + fn bitor_assign(&mut self, rhs: Modifiers) { + self.mods |= rhs; + } +} diff --git a/i4config/src/keyboard/mods.rs b/i4config/src/keyboard/mods.rs new file mode 100644 index 00000000..f363631c --- /dev/null +++ b/i4config/src/keyboard/mods.rs @@ -0,0 +1,60 @@ +use crate::keyboard::syms::KeySym; +use crate::ModifiedKeySym; +use bincode::{Decode, Encode}; +use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign}; + +#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, Default, Hash, Debug)] +pub struct Modifiers(pub u32); + +pub const SHIFT: Modifiers = Modifiers(1 << 0); +pub const LOCK: Modifiers = Modifiers(1 << 1); +pub const CTRL: Modifiers = Modifiers(1 << 2); +pub const MOD1: Modifiers = Modifiers(1 << 3); +pub const MOD2: Modifiers = Modifiers(1 << 4); +pub const MOD3: Modifiers = Modifiers(1 << 5); +pub const MOD4: Modifiers = Modifiers(1 << 6); +pub const MOD5: Modifiers = Modifiers(1 << 7); + +pub const CAPS: Modifiers = LOCK; +pub const ALT: Modifiers = MOD1; +pub const NUM: Modifiers = MOD2; +pub const LOGO: Modifiers = MOD4; + +impl BitOr for Modifiers { + type Output = Self; + + fn bitor(self, rhs: Self) -> Self::Output { + Self(self.0 | rhs.0) + } +} + +impl BitOr for Modifiers { + type Output = ModifiedKeySym; + + fn bitor(self, rhs: KeySym) -> Self::Output { + ModifiedKeySym { + mods: self, + sym: rhs, + } + } +} + +impl BitAnd for Modifiers { + type Output = Self; + + fn bitand(self, rhs: Self) -> Self::Output { + Self(self.0 & rhs.0) + } +} + +impl BitOrAssign for Modifiers { + fn bitor_assign(&mut self, rhs: Self) { + self.0 |= rhs.0 + } +} + +impl BitAndAssign for Modifiers { + fn bitand_assign(&mut self, rhs: Self) { + self.0 &= rhs.0 + } +} diff --git a/i4config/src/keyboard/syms.rs b/i4config/src/keyboard/syms.rs new file mode 100644 index 00000000..e9cc673e --- /dev/null +++ b/i4config/src/keyboard/syms.rs @@ -0,0 +1,2556 @@ +#![allow(non_upper_case_globals)] + +use bincode::{Decode, Encode}; + +#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, Hash, Debug)] +pub struct KeySym(pub u32); + +pub const SYM_BackSpace: KeySym = KeySym(0xff08); +pub const SYM_Tab: KeySym = KeySym(0xff09); +pub const SYM_Linefeed: KeySym = KeySym(0xff0a); +pub const SYM_Clear: KeySym = KeySym(0xff0b); +pub const SYM_Return: KeySym = KeySym(0xff0d); +pub const SYM_Pause: KeySym = KeySym(0xff13); +pub const SYM_Scroll_Lock: KeySym = KeySym(0xff14); +pub const SYM_Sys_Req: KeySym = KeySym(0xff15); +pub const SYM_Escape: KeySym = KeySym(0xff1b); +pub const SYM_Delete: KeySym = KeySym(0xffff); +pub const SYM_Multi_key: KeySym = KeySym(0xff20); +pub const SYM_Codeinput: KeySym = KeySym(0xff37); +pub const SYM_SingleCandidate: KeySym = KeySym(0xff3c); +pub const SYM_MultipleCandidate: KeySym = KeySym(0xff3d); +pub const SYM_PreviousCandidate: KeySym = KeySym(0xff3e); +pub const SYM_Kanji: KeySym = KeySym(0xff21); +pub const SYM_Muhenkan: KeySym = KeySym(0xff22); +pub const SYM_Henkan_Mode: KeySym = KeySym(0xff23); +pub const SYM_Henkan: KeySym = KeySym(0xff23); +pub const SYM_Romaji: KeySym = KeySym(0xff24); +pub const SYM_Hiragana: KeySym = KeySym(0xff25); +pub const SYM_Katakana: KeySym = KeySym(0xff26); +pub const SYM_Hiragana_Katakana: KeySym = KeySym(0xff27); +pub const SYM_Zenkaku: KeySym = KeySym(0xff28); +pub const SYM_Hankaku: KeySym = KeySym(0xff29); +pub const SYM_Zenkaku_Hankaku: KeySym = KeySym(0xff2a); +pub const SYM_Touroku: KeySym = KeySym(0xff2b); +pub const SYM_Massyo: KeySym = KeySym(0xff2c); +pub const SYM_Kana_Lock: KeySym = KeySym(0xff2d); +pub const SYM_Kana_Shift: KeySym = KeySym(0xff2e); +pub const SYM_Eisu_Shift: KeySym = KeySym(0xff2f); +pub const SYM_Eisu_toggle: KeySym = KeySym(0xff30); +pub const SYM_Kanji_Bangou: KeySym = KeySym(0xff37); +pub const SYM_Zen_Koho: KeySym = KeySym(0xff3d); +pub const SYM_Mae_Koho: KeySym = KeySym(0xff3e); +pub const SYM_Home: KeySym = KeySym(0xff50); +pub const SYM_Left: KeySym = KeySym(0xff51); +pub const SYM_Up: KeySym = KeySym(0xff52); +pub const SYM_Right: KeySym = KeySym(0xff53); +pub const SYM_Down: KeySym = KeySym(0xff54); +pub const SYM_Prior: KeySym = KeySym(0xff55); +pub const SYM_Page_Up: KeySym = KeySym(0xff55); +pub const SYM_Next: KeySym = KeySym(0xff56); +pub const SYM_Page_Down: KeySym = KeySym(0xff56); +pub const SYM_End: KeySym = KeySym(0xff57); +pub const SYM_Begin: KeySym = KeySym(0xff58); +pub const SYM_Select: KeySym = KeySym(0xff60); +pub const SYM_Print: KeySym = KeySym(0xff61); +pub const SYM_Execute: KeySym = KeySym(0xff62); +pub const SYM_Insert: KeySym = KeySym(0xff63); +pub const SYM_Undo: KeySym = KeySym(0xff65); +pub const SYM_Redo: KeySym = KeySym(0xff66); +pub const SYM_Menu: KeySym = KeySym(0xff67); +pub const SYM_Find: KeySym = KeySym(0xff68); +pub const SYM_Cancel: KeySym = KeySym(0xff69); +pub const SYM_Help: KeySym = KeySym(0xff6a); +pub const SYM_Break: KeySym = KeySym(0xff6b); +pub const SYM_Mode_switch: KeySym = KeySym(0xff7e); +pub const SYM_script_switch: KeySym = KeySym(0xff7e); +pub const SYM_Num_Lock: KeySym = KeySym(0xff7f); +pub const SYM_KP_Space: KeySym = KeySym(0xff80); +pub const SYM_KP_Tab: KeySym = KeySym(0xff89); +pub const SYM_KP_Enter: KeySym = KeySym(0xff8d); +pub const SYM_KP_F1: KeySym = KeySym(0xff91); +pub const SYM_KP_F2: KeySym = KeySym(0xff92); +pub const SYM_KP_F3: KeySym = KeySym(0xff93); +pub const SYM_KP_F4: KeySym = KeySym(0xff94); +pub const SYM_KP_Home: KeySym = KeySym(0xff95); +pub const SYM_KP_Left: KeySym = KeySym(0xff96); +pub const SYM_KP_Up: KeySym = KeySym(0xff97); +pub const SYM_KP_Right: KeySym = KeySym(0xff98); +pub const SYM_KP_Down: KeySym = KeySym(0xff99); +pub const SYM_KP_Prior: KeySym = KeySym(0xff9a); +pub const SYM_KP_Page_Up: KeySym = KeySym(0xff9a); +pub const SYM_KP_Next: KeySym = KeySym(0xff9b); +pub const SYM_KP_Page_Down: KeySym = KeySym(0xff9b); +pub const SYM_KP_End: KeySym = KeySym(0xff9c); +pub const SYM_KP_Begin: KeySym = KeySym(0xff9d); +pub const SYM_KP_Insert: KeySym = KeySym(0xff9e); +pub const SYM_KP_Delete: KeySym = KeySym(0xff9f); +pub const SYM_KP_Equal: KeySym = KeySym(0xffbd); +pub const SYM_KP_Multiply: KeySym = KeySym(0xffaa); +pub const SYM_KP_Add: KeySym = KeySym(0xffab); +pub const SYM_KP_Separator: KeySym = KeySym(0xffac); +pub const SYM_KP_Subtract: KeySym = KeySym(0xffad); +pub const SYM_KP_Decimal: KeySym = KeySym(0xffae); +pub const SYM_KP_Divide: KeySym = KeySym(0xffaf); +pub const SYM_KP_0: KeySym = KeySym(0xffb0); +pub const SYM_KP_1: KeySym = KeySym(0xffb1); +pub const SYM_KP_2: KeySym = KeySym(0xffb2); +pub const SYM_KP_3: KeySym = KeySym(0xffb3); +pub const SYM_KP_4: KeySym = KeySym(0xffb4); +pub const SYM_KP_5: KeySym = KeySym(0xffb5); +pub const SYM_KP_6: KeySym = KeySym(0xffb6); +pub const SYM_KP_7: KeySym = KeySym(0xffb7); +pub const SYM_KP_8: KeySym = KeySym(0xffb8); +pub const SYM_KP_9: KeySym = KeySym(0xffb9); +pub const SYM_F1: KeySym = KeySym(0xffbe); +pub const SYM_F2: KeySym = KeySym(0xffbf); +pub const SYM_F3: KeySym = KeySym(0xffc0); +pub const SYM_F4: KeySym = KeySym(0xffc1); +pub const SYM_F5: KeySym = KeySym(0xffc2); +pub const SYM_F6: KeySym = KeySym(0xffc3); +pub const SYM_F7: KeySym = KeySym(0xffc4); +pub const SYM_F8: KeySym = KeySym(0xffc5); +pub const SYM_F9: KeySym = KeySym(0xffc6); +pub const SYM_F10: KeySym = KeySym(0xffc7); +pub const SYM_F11: KeySym = KeySym(0xffc8); +pub const SYM_L1: KeySym = KeySym(0xffc8); +pub const SYM_F12: KeySym = KeySym(0xffc9); +pub const SYM_L2: KeySym = KeySym(0xffc9); +pub const SYM_F13: KeySym = KeySym(0xffca); +pub const SYM_L3: KeySym = KeySym(0xffca); +pub const SYM_F14: KeySym = KeySym(0xffcb); +pub const SYM_L4: KeySym = KeySym(0xffcb); +pub const SYM_F15: KeySym = KeySym(0xffcc); +pub const SYM_L5: KeySym = KeySym(0xffcc); +pub const SYM_F16: KeySym = KeySym(0xffcd); +pub const SYM_L6: KeySym = KeySym(0xffcd); +pub const SYM_F17: KeySym = KeySym(0xffce); +pub const SYM_L7: KeySym = KeySym(0xffce); +pub const SYM_F18: KeySym = KeySym(0xffcf); +pub const SYM_L8: KeySym = KeySym(0xffcf); +pub const SYM_F19: KeySym = KeySym(0xffd0); +pub const SYM_L9: KeySym = KeySym(0xffd0); +pub const SYM_F20: KeySym = KeySym(0xffd1); +pub const SYM_L10: KeySym = KeySym(0xffd1); +pub const SYM_F21: KeySym = KeySym(0xffd2); +pub const SYM_R1: KeySym = KeySym(0xffd2); +pub const SYM_F22: KeySym = KeySym(0xffd3); +pub const SYM_R2: KeySym = KeySym(0xffd3); +pub const SYM_F23: KeySym = KeySym(0xffd4); +pub const SYM_R3: KeySym = KeySym(0xffd4); +pub const SYM_F24: KeySym = KeySym(0xffd5); +pub const SYM_R4: KeySym = KeySym(0xffd5); +pub const SYM_F25: KeySym = KeySym(0xffd6); +pub const SYM_R5: KeySym = KeySym(0xffd6); +pub const SYM_F26: KeySym = KeySym(0xffd7); +pub const SYM_R6: KeySym = KeySym(0xffd7); +pub const SYM_F27: KeySym = KeySym(0xffd8); +pub const SYM_R7: KeySym = KeySym(0xffd8); +pub const SYM_F28: KeySym = KeySym(0xffd9); +pub const SYM_R8: KeySym = KeySym(0xffd9); +pub const SYM_F29: KeySym = KeySym(0xffda); +pub const SYM_R9: KeySym = KeySym(0xffda); +pub const SYM_F30: KeySym = KeySym(0xffdb); +pub const SYM_R10: KeySym = KeySym(0xffdb); +pub const SYM_F31: KeySym = KeySym(0xffdc); +pub const SYM_R11: KeySym = KeySym(0xffdc); +pub const SYM_F32: KeySym = KeySym(0xffdd); +pub const SYM_R12: KeySym = KeySym(0xffdd); +pub const SYM_F33: KeySym = KeySym(0xffde); +pub const SYM_R13: KeySym = KeySym(0xffde); +pub const SYM_F34: KeySym = KeySym(0xffdf); +pub const SYM_R14: KeySym = KeySym(0xffdf); +pub const SYM_F35: KeySym = KeySym(0xffe0); +pub const SYM_R15: KeySym = KeySym(0xffe0); +pub const SYM_Shift_L: KeySym = KeySym(0xffe1); +pub const SYM_Shift_R: KeySym = KeySym(0xffe2); +pub const SYM_Control_L: KeySym = KeySym(0xffe3); +pub const SYM_Control_R: KeySym = KeySym(0xffe4); +pub const SYM_Caps_Lock: KeySym = KeySym(0xffe5); +pub const SYM_Shift_Lock: KeySym = KeySym(0xffe6); +pub const SYM_Meta_L: KeySym = KeySym(0xffe7); +pub const SYM_Meta_R: KeySym = KeySym(0xffe8); +pub const SYM_Alt_L: KeySym = KeySym(0xffe9); +pub const SYM_Alt_R: KeySym = KeySym(0xffea); +pub const SYM_Super_L: KeySym = KeySym(0xffeb); +pub const SYM_Super_R: KeySym = KeySym(0xffec); +pub const SYM_Hyper_L: KeySym = KeySym(0xffed); +pub const SYM_Hyper_R: KeySym = KeySym(0xffee); +pub const SYM_ISO_Lock: KeySym = KeySym(0xfe01); +pub const SYM_ISO_Level2_Latch: KeySym = KeySym(0xfe02); +pub const SYM_ISO_Level3_Shift: KeySym = KeySym(0xfe03); +pub const SYM_ISO_Level3_Latch: KeySym = KeySym(0xfe04); +pub const SYM_ISO_Level3_Lock: KeySym = KeySym(0xfe05); +pub const SYM_ISO_Level5_Shift: KeySym = KeySym(0xfe11); +pub const SYM_ISO_Level5_Latch: KeySym = KeySym(0xfe12); +pub const SYM_ISO_Level5_Lock: KeySym = KeySym(0xfe13); +pub const SYM_ISO_Group_Shift: KeySym = KeySym(0xff7e); +pub const SYM_ISO_Group_Latch: KeySym = KeySym(0xfe06); +pub const SYM_ISO_Group_Lock: KeySym = KeySym(0xfe07); +pub const SYM_ISO_Next_Group: KeySym = KeySym(0xfe08); +pub const SYM_ISO_Next_Group_Lock: KeySym = KeySym(0xfe09); +pub const SYM_ISO_Prev_Group: KeySym = KeySym(0xfe0a); +pub const SYM_ISO_Prev_Group_Lock: KeySym = KeySym(0xfe0b); +pub const SYM_ISO_First_Group: KeySym = KeySym(0xfe0c); +pub const SYM_ISO_First_Group_Lock: KeySym = KeySym(0xfe0d); +pub const SYM_ISO_Last_Group: KeySym = KeySym(0xfe0e); +pub const SYM_ISO_Last_Group_Lock: KeySym = KeySym(0xfe0f); +pub const SYM_ISO_Left_Tab: KeySym = KeySym(0xfe20); +pub const SYM_ISO_Move_Line_Up: KeySym = KeySym(0xfe21); +pub const SYM_ISO_Move_Line_Down: KeySym = KeySym(0xfe22); +pub const SYM_ISO_Partial_Line_Up: KeySym = KeySym(0xfe23); +pub const SYM_ISO_Partial_Line_Down: KeySym = KeySym(0xfe24); +pub const SYM_ISO_Partial_Space_Left: KeySym = KeySym(0xfe25); +pub const SYM_ISO_Partial_Space_Right: KeySym = KeySym(0xfe26); +pub const SYM_ISO_Set_Margin_Left: KeySym = KeySym(0xfe27); +pub const SYM_ISO_Set_Margin_Right: KeySym = KeySym(0xfe28); +pub const SYM_ISO_Release_Margin_Left: KeySym = KeySym(0xfe29); +pub const SYM_ISO_Release_Margin_Right: KeySym = KeySym(0xfe2a); +pub const SYM_ISO_Release_Both_Margins: KeySym = KeySym(0xfe2b); +pub const SYM_ISO_Fast_Cursor_Left: KeySym = KeySym(0xfe2c); +pub const SYM_ISO_Fast_Cursor_Right: KeySym = KeySym(0xfe2d); +pub const SYM_ISO_Fast_Cursor_Up: KeySym = KeySym(0xfe2e); +pub const SYM_ISO_Fast_Cursor_Down: KeySym = KeySym(0xfe2f); +pub const SYM_ISO_Continuous_Underline: KeySym = KeySym(0xfe30); +pub const SYM_ISO_Discontinuous_Underline: KeySym = KeySym(0xfe31); +pub const SYM_ISO_Emphasize: KeySym = KeySym(0xfe32); +pub const SYM_ISO_Center_Object: KeySym = KeySym(0xfe33); +pub const SYM_ISO_Enter: KeySym = KeySym(0xfe34); +pub const SYM_dead_grave: KeySym = KeySym(0xfe50); +pub const SYM_dead_acute: KeySym = KeySym(0xfe51); +pub const SYM_dead_circumflex: KeySym = KeySym(0xfe52); +pub const SYM_dead_tilde: KeySym = KeySym(0xfe53); +pub const SYM_dead_perispomeni: KeySym = KeySym(0xfe53); +pub const SYM_dead_macron: KeySym = KeySym(0xfe54); +pub const SYM_dead_breve: KeySym = KeySym(0xfe55); +pub const SYM_dead_abovedot: KeySym = KeySym(0xfe56); +pub const SYM_dead_diaeresis: KeySym = KeySym(0xfe57); +pub const SYM_dead_abovering: KeySym = KeySym(0xfe58); +pub const SYM_dead_doubleacute: KeySym = KeySym(0xfe59); +pub const SYM_dead_caron: KeySym = KeySym(0xfe5a); +pub const SYM_dead_cedilla: KeySym = KeySym(0xfe5b); +pub const SYM_dead_ogonek: KeySym = KeySym(0xfe5c); +pub const SYM_dead_iota: KeySym = KeySym(0xfe5d); +pub const SYM_dead_voiced_sound: KeySym = KeySym(0xfe5e); +pub const SYM_dead_semivoiced_sound: KeySym = KeySym(0xfe5f); +pub const SYM_dead_belowdot: KeySym = KeySym(0xfe60); +pub const SYM_dead_hook: KeySym = KeySym(0xfe61); +pub const SYM_dead_horn: KeySym = KeySym(0xfe62); +pub const SYM_dead_stroke: KeySym = KeySym(0xfe63); +pub const SYM_dead_abovecomma: KeySym = KeySym(0xfe64); +pub const SYM_dead_psili: KeySym = KeySym(0xfe64); +pub const SYM_dead_abovereversedcomma: KeySym = KeySym(0xfe65); +pub const SYM_dead_dasia: KeySym = KeySym(0xfe65); +pub const SYM_dead_doublegrave: KeySym = KeySym(0xfe66); +pub const SYM_dead_belowring: KeySym = KeySym(0xfe67); +pub const SYM_dead_belowmacron: KeySym = KeySym(0xfe68); +pub const SYM_dead_belowcircumflex: KeySym = KeySym(0xfe69); +pub const SYM_dead_belowtilde: KeySym = KeySym(0xfe6a); +pub const SYM_dead_belowbreve: KeySym = KeySym(0xfe6b); +pub const SYM_dead_belowdiaeresis: KeySym = KeySym(0xfe6c); +pub const SYM_dead_invertedbreve: KeySym = KeySym(0xfe6d); +pub const SYM_dead_belowcomma: KeySym = KeySym(0xfe6e); +pub const SYM_dead_currency: KeySym = KeySym(0xfe6f); +pub const SYM_dead_lowline: KeySym = KeySym(0xfe90); +pub const SYM_dead_aboveverticalline: KeySym = KeySym(0xfe91); +pub const SYM_dead_belowverticalline: KeySym = KeySym(0xfe92); +pub const SYM_dead_longsolidusoverlay: KeySym = KeySym(0xfe93); +pub const SYM_dead_a: KeySym = KeySym(0xfe80); +pub const SYM_dead_A: KeySym = KeySym(0xfe81); +pub const SYM_dead_e: KeySym = KeySym(0xfe82); +pub const SYM_dead_E: KeySym = KeySym(0xfe83); +pub const SYM_dead_i: KeySym = KeySym(0xfe84); +pub const SYM_dead_I: KeySym = KeySym(0xfe85); +pub const SYM_dead_o: KeySym = KeySym(0xfe86); +pub const SYM_dead_O: KeySym = KeySym(0xfe87); +pub const SYM_dead_u: KeySym = KeySym(0xfe88); +pub const SYM_dead_U: KeySym = KeySym(0xfe89); +pub const SYM_dead_small_schwa: KeySym = KeySym(0xfe8a); +pub const SYM_dead_capital_schwa: KeySym = KeySym(0xfe8b); +pub const SYM_dead_greek: KeySym = KeySym(0xfe8c); +pub const SYM_First_Virtual_Screen: KeySym = KeySym(0xfed0); +pub const SYM_Prev_Virtual_Screen: KeySym = KeySym(0xfed1); +pub const SYM_Next_Virtual_Screen: KeySym = KeySym(0xfed2); +pub const SYM_Last_Virtual_Screen: KeySym = KeySym(0xfed4); +pub const SYM_Terminate_Server: KeySym = KeySym(0xfed5); +pub const SYM_AccessX_Enable: KeySym = KeySym(0xfe70); +pub const SYM_AccessX_Feedback_Enable: KeySym = KeySym(0xfe71); +pub const SYM_RepeatKeys_Enable: KeySym = KeySym(0xfe72); +pub const SYM_SlowKeys_Enable: KeySym = KeySym(0xfe73); +pub const SYM_BounceKeys_Enable: KeySym = KeySym(0xfe74); +pub const SYM_StickyKeys_Enable: KeySym = KeySym(0xfe75); +pub const SYM_MouseKeys_Enable: KeySym = KeySym(0xfe76); +pub const SYM_MouseKeys_Accel_Enable: KeySym = KeySym(0xfe77); +pub const SYM_Overlay1_Enable: KeySym = KeySym(0xfe78); +pub const SYM_Overlay2_Enable: KeySym = KeySym(0xfe79); +pub const SYM_AudibleBell_Enable: KeySym = KeySym(0xfe7a); +pub const SYM_Pointer_Left: KeySym = KeySym(0xfee0); +pub const SYM_Pointer_Right: KeySym = KeySym(0xfee1); +pub const SYM_Pointer_Up: KeySym = KeySym(0xfee2); +pub const SYM_Pointer_Down: KeySym = KeySym(0xfee3); +pub const SYM_Pointer_UpLeft: KeySym = KeySym(0xfee4); +pub const SYM_Pointer_UpRight: KeySym = KeySym(0xfee5); +pub const SYM_Pointer_DownLeft: KeySym = KeySym(0xfee6); +pub const SYM_Pointer_DownRight: KeySym = KeySym(0xfee7); +pub const SYM_Pointer_Button_Dflt: KeySym = KeySym(0xfee8); +pub const SYM_Pointer_Button1: KeySym = KeySym(0xfee9); +pub const SYM_Pointer_Button2: KeySym = KeySym(0xfeea); +pub const SYM_Pointer_Button3: KeySym = KeySym(0xfeeb); +pub const SYM_Pointer_Button4: KeySym = KeySym(0xfeec); +pub const SYM_Pointer_Button5: KeySym = KeySym(0xfeed); +pub const SYM_Pointer_DblClick_Dflt: KeySym = KeySym(0xfeee); +pub const SYM_Pointer_DblClick1: KeySym = KeySym(0xfeef); +pub const SYM_Pointer_DblClick2: KeySym = KeySym(0xfef0); +pub const SYM_Pointer_DblClick3: KeySym = KeySym(0xfef1); +pub const SYM_Pointer_DblClick4: KeySym = KeySym(0xfef2); +pub const SYM_Pointer_DblClick5: KeySym = KeySym(0xfef3); +pub const SYM_Pointer_Drag_Dflt: KeySym = KeySym(0xfef4); +pub const SYM_Pointer_Drag1: KeySym = KeySym(0xfef5); +pub const SYM_Pointer_Drag2: KeySym = KeySym(0xfef6); +pub const SYM_Pointer_Drag3: KeySym = KeySym(0xfef7); +pub const SYM_Pointer_Drag4: KeySym = KeySym(0xfef8); +pub const SYM_Pointer_Drag5: KeySym = KeySym(0xfefd); +pub const SYM_Pointer_EnableKeys: KeySym = KeySym(0xfef9); +pub const SYM_Pointer_Accelerate: KeySym = KeySym(0xfefa); +pub const SYM_Pointer_DfltBtnNext: KeySym = KeySym(0xfefb); +pub const SYM_Pointer_DfltBtnPrev: KeySym = KeySym(0xfefc); +pub const SYM_ch: KeySym = KeySym(0xfea0); +pub const SYM_Ch: KeySym = KeySym(0xfea1); +pub const SYM_CH: KeySym = KeySym(0xfea2); +pub const SYM_c_h: KeySym = KeySym(0xfea3); +pub const SYM_C_h: KeySym = KeySym(0xfea4); +pub const SYM_C_H: KeySym = KeySym(0xfea5); +pub const SYM_3270_Duplicate: KeySym = KeySym(0xfd01); +pub const SYM_3270_FieldMark: KeySym = KeySym(0xfd02); +pub const SYM_3270_Right2: KeySym = KeySym(0xfd03); +pub const SYM_3270_Left2: KeySym = KeySym(0xfd04); +pub const SYM_3270_BackTab: KeySym = KeySym(0xfd05); +pub const SYM_3270_EraseEOF: KeySym = KeySym(0xfd06); +pub const SYM_3270_EraseInput: KeySym = KeySym(0xfd07); +pub const SYM_3270_Reset: KeySym = KeySym(0xfd08); +pub const SYM_3270_Quit: KeySym = KeySym(0xfd09); +pub const SYM_3270_PA1: KeySym = KeySym(0xfd0a); +pub const SYM_3270_PA2: KeySym = KeySym(0xfd0b); +pub const SYM_3270_PA3: KeySym = KeySym(0xfd0c); +pub const SYM_3270_Test: KeySym = KeySym(0xfd0d); +pub const SYM_3270_Attn: KeySym = KeySym(0xfd0e); +pub const SYM_3270_CursorBlink: KeySym = KeySym(0xfd0f); +pub const SYM_3270_AltCursor: KeySym = KeySym(0xfd10); +pub const SYM_3270_KeyClick: KeySym = KeySym(0xfd11); +pub const SYM_3270_Jump: KeySym = KeySym(0xfd12); +pub const SYM_3270_Ident: KeySym = KeySym(0xfd13); +pub const SYM_3270_Rule: KeySym = KeySym(0xfd14); +pub const SYM_3270_Copy: KeySym = KeySym(0xfd15); +pub const SYM_3270_Play: KeySym = KeySym(0xfd16); +pub const SYM_3270_Setup: KeySym = KeySym(0xfd17); +pub const SYM_3270_Record: KeySym = KeySym(0xfd18); +pub const SYM_3270_ChangeScreen: KeySym = KeySym(0xfd19); +pub const SYM_3270_DeleteWord: KeySym = KeySym(0xfd1a); +pub const SYM_3270_ExSelect: KeySym = KeySym(0xfd1b); +pub const SYM_3270_CursorSelect: KeySym = KeySym(0xfd1c); +pub const SYM_3270_PrintScreen: KeySym = KeySym(0xfd1d); +pub const SYM_3270_Enter: KeySym = KeySym(0xfd1e); +pub const SYM_space: KeySym = KeySym(0x0020); +pub const SYM_exclam: KeySym = KeySym(0x0021); +pub const SYM_quotedbl: KeySym = KeySym(0x0022); +pub const SYM_numbersign: KeySym = KeySym(0x0023); +pub const SYM_dollar: KeySym = KeySym(0x0024); +pub const SYM_percent: KeySym = KeySym(0x0025); +pub const SYM_ampersand: KeySym = KeySym(0x0026); +pub const SYM_apostrophe: KeySym = KeySym(0x0027); +pub const SYM_quoteright: KeySym = KeySym(0x0027); +pub const SYM_parenleft: KeySym = KeySym(0x0028); +pub const SYM_parenright: KeySym = KeySym(0x0029); +pub const SYM_asterisk: KeySym = KeySym(0x002a); +pub const SYM_plus: KeySym = KeySym(0x002b); +pub const SYM_comma: KeySym = KeySym(0x002c); +pub const SYM_minus: KeySym = KeySym(0x002d); +pub const SYM_period: KeySym = KeySym(0x002e); +pub const SYM_slash: KeySym = KeySym(0x002f); +pub const SYM_0: KeySym = KeySym(0x0030); +pub const SYM_1: KeySym = KeySym(0x0031); +pub const SYM_2: KeySym = KeySym(0x0032); +pub const SYM_3: KeySym = KeySym(0x0033); +pub const SYM_4: KeySym = KeySym(0x0034); +pub const SYM_5: KeySym = KeySym(0x0035); +pub const SYM_6: KeySym = KeySym(0x0036); +pub const SYM_7: KeySym = KeySym(0x0037); +pub const SYM_8: KeySym = KeySym(0x0038); +pub const SYM_9: KeySym = KeySym(0x0039); +pub const SYM_colon: KeySym = KeySym(0x003a); +pub const SYM_semicolon: KeySym = KeySym(0x003b); +pub const SYM_less: KeySym = KeySym(0x003c); +pub const SYM_equal: KeySym = KeySym(0x003d); +pub const SYM_greater: KeySym = KeySym(0x003e); +pub const SYM_question: KeySym = KeySym(0x003f); +pub const SYM_at: KeySym = KeySym(0x0040); +pub const SYM_A: KeySym = KeySym(0x0041); +pub const SYM_B: KeySym = KeySym(0x0042); +pub const SYM_C: KeySym = KeySym(0x0043); +pub const SYM_D: KeySym = KeySym(0x0044); +pub const SYM_E: KeySym = KeySym(0x0045); +pub const SYM_F: KeySym = KeySym(0x0046); +pub const SYM_G: KeySym = KeySym(0x0047); +pub const SYM_H: KeySym = KeySym(0x0048); +pub const SYM_I: KeySym = KeySym(0x0049); +pub const SYM_J: KeySym = KeySym(0x004a); +pub const SYM_K: KeySym = KeySym(0x004b); +pub const SYM_L: KeySym = KeySym(0x004c); +pub const SYM_M: KeySym = KeySym(0x004d); +pub const SYM_N: KeySym = KeySym(0x004e); +pub const SYM_O: KeySym = KeySym(0x004f); +pub const SYM_P: KeySym = KeySym(0x0050); +pub const SYM_Q: KeySym = KeySym(0x0051); +pub const SYM_R: KeySym = KeySym(0x0052); +pub const SYM_S: KeySym = KeySym(0x0053); +pub const SYM_T: KeySym = KeySym(0x0054); +pub const SYM_U: KeySym = KeySym(0x0055); +pub const SYM_V: KeySym = KeySym(0x0056); +pub const SYM_W: KeySym = KeySym(0x0057); +pub const SYM_X: KeySym = KeySym(0x0058); +pub const SYM_Y: KeySym = KeySym(0x0059); +pub const SYM_Z: KeySym = KeySym(0x005a); +pub const SYM_bracketleft: KeySym = KeySym(0x005b); +pub const SYM_backslash: KeySym = KeySym(0x005c); +pub const SYM_bracketright: KeySym = KeySym(0x005d); +pub const SYM_asciicircum: KeySym = KeySym(0x005e); +pub const SYM_underscore: KeySym = KeySym(0x005f); +pub const SYM_grave: KeySym = KeySym(0x0060); +pub const SYM_quoteleft: KeySym = KeySym(0x0060); +pub const SYM_a: KeySym = KeySym(0x0061); +pub const SYM_b: KeySym = KeySym(0x0062); +pub const SYM_c: KeySym = KeySym(0x0063); +pub const SYM_d: KeySym = KeySym(0x0064); +pub const SYM_e: KeySym = KeySym(0x0065); +pub const SYM_f: KeySym = KeySym(0x0066); +pub const SYM_g: KeySym = KeySym(0x0067); +pub const SYM_h: KeySym = KeySym(0x0068); +pub const SYM_i: KeySym = KeySym(0x0069); +pub const SYM_j: KeySym = KeySym(0x006a); +pub const SYM_k: KeySym = KeySym(0x006b); +pub const SYM_l: KeySym = KeySym(0x006c); +pub const SYM_m: KeySym = KeySym(0x006d); +pub const SYM_n: KeySym = KeySym(0x006e); +pub const SYM_o: KeySym = KeySym(0x006f); +pub const SYM_p: KeySym = KeySym(0x0070); +pub const SYM_q: KeySym = KeySym(0x0071); +pub const SYM_r: KeySym = KeySym(0x0072); +pub const SYM_s: KeySym = KeySym(0x0073); +pub const SYM_t: KeySym = KeySym(0x0074); +pub const SYM_u: KeySym = KeySym(0x0075); +pub const SYM_v: KeySym = KeySym(0x0076); +pub const SYM_w: KeySym = KeySym(0x0077); +pub const SYM_x: KeySym = KeySym(0x0078); +pub const SYM_y: KeySym = KeySym(0x0079); +pub const SYM_z: KeySym = KeySym(0x007a); +pub const SYM_braceleft: KeySym = KeySym(0x007b); +pub const SYM_bar: KeySym = KeySym(0x007c); +pub const SYM_braceright: KeySym = KeySym(0x007d); +pub const SYM_asciitilde: KeySym = KeySym(0x007e); +pub const SYM_nobreakspace: KeySym = KeySym(0x00a0); +pub const SYM_exclamdown: KeySym = KeySym(0x00a1); +pub const SYM_cent: KeySym = KeySym(0x00a2); +pub const SYM_sterling: KeySym = KeySym(0x00a3); +pub const SYM_currency: KeySym = KeySym(0x00a4); +pub const SYM_yen: KeySym = KeySym(0x00a5); +pub const SYM_brokenbar: KeySym = KeySym(0x00a6); +pub const SYM_section: KeySym = KeySym(0x00a7); +pub const SYM_diaeresis: KeySym = KeySym(0x00a8); +pub const SYM_copyright: KeySym = KeySym(0x00a9); +pub const SYM_ordfeminine: KeySym = KeySym(0x00aa); +pub const SYM_guillemotleft: KeySym = KeySym(0x00ab); +pub const SYM_notsign: KeySym = KeySym(0x00ac); +pub const SYM_hyphen: KeySym = KeySym(0x00ad); +pub const SYM_registered: KeySym = KeySym(0x00ae); +pub const SYM_macron: KeySym = KeySym(0x00af); +pub const SYM_degree: KeySym = KeySym(0x00b0); +pub const SYM_plusminus: KeySym = KeySym(0x00b1); +pub const SYM_twosuperior: KeySym = KeySym(0x00b2); +pub const SYM_threesuperior: KeySym = KeySym(0x00b3); +pub const SYM_acute: KeySym = KeySym(0x00b4); +pub const SYM_mu: KeySym = KeySym(0x00b5); +pub const SYM_paragraph: KeySym = KeySym(0x00b6); +pub const SYM_periodcentered: KeySym = KeySym(0x00b7); +pub const SYM_cedilla: KeySym = KeySym(0x00b8); +pub const SYM_onesuperior: KeySym = KeySym(0x00b9); +pub const SYM_masculine: KeySym = KeySym(0x00ba); +pub const SYM_guillemotright: KeySym = KeySym(0x00bb); +pub const SYM_onequarter: KeySym = KeySym(0x00bc); +pub const SYM_onehalf: KeySym = KeySym(0x00bd); +pub const SYM_threequarters: KeySym = KeySym(0x00be); +pub const SYM_questiondown: KeySym = KeySym(0x00bf); +pub const SYM_Agrave: KeySym = KeySym(0x00c0); +pub const SYM_Aacute: KeySym = KeySym(0x00c1); +pub const SYM_Acircumflex: KeySym = KeySym(0x00c2); +pub const SYM_Atilde: KeySym = KeySym(0x00c3); +pub const SYM_Adiaeresis: KeySym = KeySym(0x00c4); +pub const SYM_Aring: KeySym = KeySym(0x00c5); +pub const SYM_AE: KeySym = KeySym(0x00c6); +pub const SYM_Ccedilla: KeySym = KeySym(0x00c7); +pub const SYM_Egrave: KeySym = KeySym(0x00c8); +pub const SYM_Eacute: KeySym = KeySym(0x00c9); +pub const SYM_Ecircumflex: KeySym = KeySym(0x00ca); +pub const SYM_Ediaeresis: KeySym = KeySym(0x00cb); +pub const SYM_Igrave: KeySym = KeySym(0x00cc); +pub const SYM_Iacute: KeySym = KeySym(0x00cd); +pub const SYM_Icircumflex: KeySym = KeySym(0x00ce); +pub const SYM_Idiaeresis: KeySym = KeySym(0x00cf); +pub const SYM_ETH: KeySym = KeySym(0x00d0); +pub const SYM_Eth: KeySym = KeySym(0x00d0); +pub const SYM_Ntilde: KeySym = KeySym(0x00d1); +pub const SYM_Ograve: KeySym = KeySym(0x00d2); +pub const SYM_Oacute: KeySym = KeySym(0x00d3); +pub const SYM_Ocircumflex: KeySym = KeySym(0x00d4); +pub const SYM_Otilde: KeySym = KeySym(0x00d5); +pub const SYM_Odiaeresis: KeySym = KeySym(0x00d6); +pub const SYM_multiply: KeySym = KeySym(0x00d7); +pub const SYM_Oslash: KeySym = KeySym(0x00d8); +pub const SYM_Ooblique: KeySym = KeySym(0x00d8); +pub const SYM_Ugrave: KeySym = KeySym(0x00d9); +pub const SYM_Uacute: KeySym = KeySym(0x00da); +pub const SYM_Ucircumflex: KeySym = KeySym(0x00db); +pub const SYM_Udiaeresis: KeySym = KeySym(0x00dc); +pub const SYM_Yacute: KeySym = KeySym(0x00dd); +pub const SYM_THORN: KeySym = KeySym(0x00de); +pub const SYM_Thorn: KeySym = KeySym(0x00de); +pub const SYM_ssharp: KeySym = KeySym(0x00df); +pub const SYM_agrave: KeySym = KeySym(0x00e0); +pub const SYM_aacute: KeySym = KeySym(0x00e1); +pub const SYM_acircumflex: KeySym = KeySym(0x00e2); +pub const SYM_atilde: KeySym = KeySym(0x00e3); +pub const SYM_adiaeresis: KeySym = KeySym(0x00e4); +pub const SYM_aring: KeySym = KeySym(0x00e5); +pub const SYM_ae: KeySym = KeySym(0x00e6); +pub const SYM_ccedilla: KeySym = KeySym(0x00e7); +pub const SYM_egrave: KeySym = KeySym(0x00e8); +pub const SYM_eacute: KeySym = KeySym(0x00e9); +pub const SYM_ecircumflex: KeySym = KeySym(0x00ea); +pub const SYM_ediaeresis: KeySym = KeySym(0x00eb); +pub const SYM_igrave: KeySym = KeySym(0x00ec); +pub const SYM_iacute: KeySym = KeySym(0x00ed); +pub const SYM_icircumflex: KeySym = KeySym(0x00ee); +pub const SYM_idiaeresis: KeySym = KeySym(0x00ef); +pub const SYM_eth: KeySym = KeySym(0x00f0); +pub const SYM_ntilde: KeySym = KeySym(0x00f1); +pub const SYM_ograve: KeySym = KeySym(0x00f2); +pub const SYM_oacute: KeySym = KeySym(0x00f3); +pub const SYM_ocircumflex: KeySym = KeySym(0x00f4); +pub const SYM_otilde: KeySym = KeySym(0x00f5); +pub const SYM_odiaeresis: KeySym = KeySym(0x00f6); +pub const SYM_division: KeySym = KeySym(0x00f7); +pub const SYM_oslash: KeySym = KeySym(0x00f8); +pub const SYM_ooblique: KeySym = KeySym(0x00f8); +pub const SYM_ugrave: KeySym = KeySym(0x00f9); +pub const SYM_uacute: KeySym = KeySym(0x00fa); +pub const SYM_ucircumflex: KeySym = KeySym(0x00fb); +pub const SYM_udiaeresis: KeySym = KeySym(0x00fc); +pub const SYM_yacute: KeySym = KeySym(0x00fd); +pub const SYM_thorn: KeySym = KeySym(0x00fe); +pub const SYM_ydiaeresis: KeySym = KeySym(0x00ff); +pub const SYM_Aogonek: KeySym = KeySym(0x01a1); +pub const SYM_breve: KeySym = KeySym(0x01a2); +pub const SYM_Lstroke: KeySym = KeySym(0x01a3); +pub const SYM_Lcaron: KeySym = KeySym(0x01a5); +pub const SYM_Sacute: KeySym = KeySym(0x01a6); +pub const SYM_Scaron: KeySym = KeySym(0x01a9); +pub const SYM_Scedilla: KeySym = KeySym(0x01aa); +pub const SYM_Tcaron: KeySym = KeySym(0x01ab); +pub const SYM_Zacute: KeySym = KeySym(0x01ac); +pub const SYM_Zcaron: KeySym = KeySym(0x01ae); +pub const SYM_Zabovedot: KeySym = KeySym(0x01af); +pub const SYM_aogonek: KeySym = KeySym(0x01b1); +pub const SYM_ogonek: KeySym = KeySym(0x01b2); +pub const SYM_lstroke: KeySym = KeySym(0x01b3); +pub const SYM_lcaron: KeySym = KeySym(0x01b5); +pub const SYM_sacute: KeySym = KeySym(0x01b6); +pub const SYM_caron: KeySym = KeySym(0x01b7); +pub const SYM_scaron: KeySym = KeySym(0x01b9); +pub const SYM_scedilla: KeySym = KeySym(0x01ba); +pub const SYM_tcaron: KeySym = KeySym(0x01bb); +pub const SYM_zacute: KeySym = KeySym(0x01bc); +pub const SYM_doubleacute: KeySym = KeySym(0x01bd); +pub const SYM_zcaron: KeySym = KeySym(0x01be); +pub const SYM_zabovedot: KeySym = KeySym(0x01bf); +pub const SYM_Racute: KeySym = KeySym(0x01c0); +pub const SYM_Abreve: KeySym = KeySym(0x01c3); +pub const SYM_Lacute: KeySym = KeySym(0x01c5); +pub const SYM_Cacute: KeySym = KeySym(0x01c6); +pub const SYM_Ccaron: KeySym = KeySym(0x01c8); +pub const SYM_Eogonek: KeySym = KeySym(0x01ca); +pub const SYM_Ecaron: KeySym = KeySym(0x01cc); +pub const SYM_Dcaron: KeySym = KeySym(0x01cf); +pub const SYM_Dstroke: KeySym = KeySym(0x01d0); +pub const SYM_Nacute: KeySym = KeySym(0x01d1); +pub const SYM_Ncaron: KeySym = KeySym(0x01d2); +pub const SYM_Odoubleacute: KeySym = KeySym(0x01d5); +pub const SYM_Rcaron: KeySym = KeySym(0x01d8); +pub const SYM_Uring: KeySym = KeySym(0x01d9); +pub const SYM_Udoubleacute: KeySym = KeySym(0x01db); +pub const SYM_Tcedilla: KeySym = KeySym(0x01de); +pub const SYM_racute: KeySym = KeySym(0x01e0); +pub const SYM_abreve: KeySym = KeySym(0x01e3); +pub const SYM_lacute: KeySym = KeySym(0x01e5); +pub const SYM_cacute: KeySym = KeySym(0x01e6); +pub const SYM_ccaron: KeySym = KeySym(0x01e8); +pub const SYM_eogonek: KeySym = KeySym(0x01ea); +pub const SYM_ecaron: KeySym = KeySym(0x01ec); +pub const SYM_dcaron: KeySym = KeySym(0x01ef); +pub const SYM_dstroke: KeySym = KeySym(0x01f0); +pub const SYM_nacute: KeySym = KeySym(0x01f1); +pub const SYM_ncaron: KeySym = KeySym(0x01f2); +pub const SYM_odoubleacute: KeySym = KeySym(0x01f5); +pub const SYM_rcaron: KeySym = KeySym(0x01f8); +pub const SYM_uring: KeySym = KeySym(0x01f9); +pub const SYM_udoubleacute: KeySym = KeySym(0x01fb); +pub const SYM_tcedilla: KeySym = KeySym(0x01fe); +pub const SYM_abovedot: KeySym = KeySym(0x01ff); +pub const SYM_Hstroke: KeySym = KeySym(0x02a1); +pub const SYM_Hcircumflex: KeySym = KeySym(0x02a6); +pub const SYM_Iabovedot: KeySym = KeySym(0x02a9); +pub const SYM_Gbreve: KeySym = KeySym(0x02ab); +pub const SYM_Jcircumflex: KeySym = KeySym(0x02ac); +pub const SYM_hstroke: KeySym = KeySym(0x02b1); +pub const SYM_hcircumflex: KeySym = KeySym(0x02b6); +pub const SYM_idotless: KeySym = KeySym(0x02b9); +pub const SYM_gbreve: KeySym = KeySym(0x02bb); +pub const SYM_jcircumflex: KeySym = KeySym(0x02bc); +pub const SYM_Cabovedot: KeySym = KeySym(0x02c5); +pub const SYM_Ccircumflex: KeySym = KeySym(0x02c6); +pub const SYM_Gabovedot: KeySym = KeySym(0x02d5); +pub const SYM_Gcircumflex: KeySym = KeySym(0x02d8); +pub const SYM_Ubreve: KeySym = KeySym(0x02dd); +pub const SYM_Scircumflex: KeySym = KeySym(0x02de); +pub const SYM_cabovedot: KeySym = KeySym(0x02e5); +pub const SYM_ccircumflex: KeySym = KeySym(0x02e6); +pub const SYM_gabovedot: KeySym = KeySym(0x02f5); +pub const SYM_gcircumflex: KeySym = KeySym(0x02f8); +pub const SYM_ubreve: KeySym = KeySym(0x02fd); +pub const SYM_scircumflex: KeySym = KeySym(0x02fe); +pub const SYM_kra: KeySym = KeySym(0x03a2); +pub const SYM_kappa: KeySym = KeySym(0x03a2); +pub const SYM_Rcedilla: KeySym = KeySym(0x03a3); +pub const SYM_Itilde: KeySym = KeySym(0x03a5); +pub const SYM_Lcedilla: KeySym = KeySym(0x03a6); +pub const SYM_Emacron: KeySym = KeySym(0x03aa); +pub const SYM_Gcedilla: KeySym = KeySym(0x03ab); +pub const SYM_Tslash: KeySym = KeySym(0x03ac); +pub const SYM_rcedilla: KeySym = KeySym(0x03b3); +pub const SYM_itilde: KeySym = KeySym(0x03b5); +pub const SYM_lcedilla: KeySym = KeySym(0x03b6); +pub const SYM_emacron: KeySym = KeySym(0x03ba); +pub const SYM_gcedilla: KeySym = KeySym(0x03bb); +pub const SYM_tslash: KeySym = KeySym(0x03bc); +pub const SYM_ENG: KeySym = KeySym(0x03bd); +pub const SYM_eng: KeySym = KeySym(0x03bf); +pub const SYM_Amacron: KeySym = KeySym(0x03c0); +pub const SYM_Iogonek: KeySym = KeySym(0x03c7); +pub const SYM_Eabovedot: KeySym = KeySym(0x03cc); +pub const SYM_Imacron: KeySym = KeySym(0x03cf); +pub const SYM_Ncedilla: KeySym = KeySym(0x03d1); +pub const SYM_Omacron: KeySym = KeySym(0x03d2); +pub const SYM_Kcedilla: KeySym = KeySym(0x03d3); +pub const SYM_Uogonek: KeySym = KeySym(0x03d9); +pub const SYM_Utilde: KeySym = KeySym(0x03dd); +pub const SYM_Umacron: KeySym = KeySym(0x03de); +pub const SYM_amacron: KeySym = KeySym(0x03e0); +pub const SYM_iogonek: KeySym = KeySym(0x03e7); +pub const SYM_eabovedot: KeySym = KeySym(0x03ec); +pub const SYM_imacron: KeySym = KeySym(0x03ef); +pub const SYM_ncedilla: KeySym = KeySym(0x03f1); +pub const SYM_omacron: KeySym = KeySym(0x03f2); +pub const SYM_kcedilla: KeySym = KeySym(0x03f3); +pub const SYM_uogonek: KeySym = KeySym(0x03f9); +pub const SYM_utilde: KeySym = KeySym(0x03fd); +pub const SYM_umacron: KeySym = KeySym(0x03fe); +pub const SYM_Wcircumflex: KeySym = KeySym(0x1000174); +pub const SYM_wcircumflex: KeySym = KeySym(0x1000175); +pub const SYM_Ycircumflex: KeySym = KeySym(0x1000176); +pub const SYM_ycircumflex: KeySym = KeySym(0x1000177); +pub const SYM_Babovedot: KeySym = KeySym(0x1001e02); +pub const SYM_babovedot: KeySym = KeySym(0x1001e03); +pub const SYM_Dabovedot: KeySym = KeySym(0x1001e0a); +pub const SYM_dabovedot: KeySym = KeySym(0x1001e0b); +pub const SYM_Fabovedot: KeySym = KeySym(0x1001e1e); +pub const SYM_fabovedot: KeySym = KeySym(0x1001e1f); +pub const SYM_Mabovedot: KeySym = KeySym(0x1001e40); +pub const SYM_mabovedot: KeySym = KeySym(0x1001e41); +pub const SYM_Pabovedot: KeySym = KeySym(0x1001e56); +pub const SYM_pabovedot: KeySym = KeySym(0x1001e57); +pub const SYM_Sabovedot: KeySym = KeySym(0x1001e60); +pub const SYM_sabovedot: KeySym = KeySym(0x1001e61); +pub const SYM_Tabovedot: KeySym = KeySym(0x1001e6a); +pub const SYM_tabovedot: KeySym = KeySym(0x1001e6b); +pub const SYM_Wgrave: KeySym = KeySym(0x1001e80); +pub const SYM_wgrave: KeySym = KeySym(0x1001e81); +pub const SYM_Wacute: KeySym = KeySym(0x1001e82); +pub const SYM_wacute: KeySym = KeySym(0x1001e83); +pub const SYM_Wdiaeresis: KeySym = KeySym(0x1001e84); +pub const SYM_wdiaeresis: KeySym = KeySym(0x1001e85); +pub const SYM_Ygrave: KeySym = KeySym(0x1001ef2); +pub const SYM_ygrave: KeySym = KeySym(0x1001ef3); +pub const SYM_OE: KeySym = KeySym(0x13bc); +pub const SYM_oe: KeySym = KeySym(0x13bd); +pub const SYM_Ydiaeresis: KeySym = KeySym(0x13be); +pub const SYM_overline: KeySym = KeySym(0x047e); +pub const SYM_kana_fullstop: KeySym = KeySym(0x04a1); +pub const SYM_kana_openingbracket: KeySym = KeySym(0x04a2); +pub const SYM_kana_closingbracket: KeySym = KeySym(0x04a3); +pub const SYM_kana_comma: KeySym = KeySym(0x04a4); +pub const SYM_kana_conjunctive: KeySym = KeySym(0x04a5); +pub const SYM_kana_middledot: KeySym = KeySym(0x04a5); +pub const SYM_kana_WO: KeySym = KeySym(0x04a6); +pub const SYM_kana_a: KeySym = KeySym(0x04a7); +pub const SYM_kana_i: KeySym = KeySym(0x04a8); +pub const SYM_kana_u: KeySym = KeySym(0x04a9); +pub const SYM_kana_e: KeySym = KeySym(0x04aa); +pub const SYM_kana_o: KeySym = KeySym(0x04ab); +pub const SYM_kana_ya: KeySym = KeySym(0x04ac); +pub const SYM_kana_yu: KeySym = KeySym(0x04ad); +pub const SYM_kana_yo: KeySym = KeySym(0x04ae); +pub const SYM_kana_tsu: KeySym = KeySym(0x04af); +pub const SYM_kana_tu: KeySym = KeySym(0x04af); +pub const SYM_prolongedsound: KeySym = KeySym(0x04b0); +pub const SYM_kana_A: KeySym = KeySym(0x04b1); +pub const SYM_kana_I: KeySym = KeySym(0x04b2); +pub const SYM_kana_U: KeySym = KeySym(0x04b3); +pub const SYM_kana_E: KeySym = KeySym(0x04b4); +pub const SYM_kana_O: KeySym = KeySym(0x04b5); +pub const SYM_kana_KA: KeySym = KeySym(0x04b6); +pub const SYM_kana_KI: KeySym = KeySym(0x04b7); +pub const SYM_kana_KU: KeySym = KeySym(0x04b8); +pub const SYM_kana_KE: KeySym = KeySym(0x04b9); +pub const SYM_kana_KO: KeySym = KeySym(0x04ba); +pub const SYM_kana_SA: KeySym = KeySym(0x04bb); +pub const SYM_kana_SHI: KeySym = KeySym(0x04bc); +pub const SYM_kana_SU: KeySym = KeySym(0x04bd); +pub const SYM_kana_SE: KeySym = KeySym(0x04be); +pub const SYM_kana_SO: KeySym = KeySym(0x04bf); +pub const SYM_kana_TA: KeySym = KeySym(0x04c0); +pub const SYM_kana_CHI: KeySym = KeySym(0x04c1); +pub const SYM_kana_TI: KeySym = KeySym(0x04c1); +pub const SYM_kana_TSU: KeySym = KeySym(0x04c2); +pub const SYM_kana_TU: KeySym = KeySym(0x04c2); +pub const SYM_kana_TE: KeySym = KeySym(0x04c3); +pub const SYM_kana_TO: KeySym = KeySym(0x04c4); +pub const SYM_kana_NA: KeySym = KeySym(0x04c5); +pub const SYM_kana_NI: KeySym = KeySym(0x04c6); +pub const SYM_kana_NU: KeySym = KeySym(0x04c7); +pub const SYM_kana_NE: KeySym = KeySym(0x04c8); +pub const SYM_kana_NO: KeySym = KeySym(0x04c9); +pub const SYM_kana_HA: KeySym = KeySym(0x04ca); +pub const SYM_kana_HI: KeySym = KeySym(0x04cb); +pub const SYM_kana_FU: KeySym = KeySym(0x04cc); +pub const SYM_kana_HU: KeySym = KeySym(0x04cc); +pub const SYM_kana_HE: KeySym = KeySym(0x04cd); +pub const SYM_kana_HO: KeySym = KeySym(0x04ce); +pub const SYM_kana_MA: KeySym = KeySym(0x04cf); +pub const SYM_kana_MI: KeySym = KeySym(0x04d0); +pub const SYM_kana_MU: KeySym = KeySym(0x04d1); +pub const SYM_kana_ME: KeySym = KeySym(0x04d2); +pub const SYM_kana_MO: KeySym = KeySym(0x04d3); +pub const SYM_kana_YA: KeySym = KeySym(0x04d4); +pub const SYM_kana_YU: KeySym = KeySym(0x04d5); +pub const SYM_kana_YO: KeySym = KeySym(0x04d6); +pub const SYM_kana_RA: KeySym = KeySym(0x04d7); +pub const SYM_kana_RI: KeySym = KeySym(0x04d8); +pub const SYM_kana_RU: KeySym = KeySym(0x04d9); +pub const SYM_kana_RE: KeySym = KeySym(0x04da); +pub const SYM_kana_RO: KeySym = KeySym(0x04db); +pub const SYM_kana_WA: KeySym = KeySym(0x04dc); +pub const SYM_kana_N: KeySym = KeySym(0x04dd); +pub const SYM_voicedsound: KeySym = KeySym(0x04de); +pub const SYM_semivoicedsound: KeySym = KeySym(0x04df); +pub const SYM_kana_switch: KeySym = KeySym(0xff7e); +pub const SYM_Farsi_0: KeySym = KeySym(0x10006f0); +pub const SYM_Farsi_1: KeySym = KeySym(0x10006f1); +pub const SYM_Farsi_2: KeySym = KeySym(0x10006f2); +pub const SYM_Farsi_3: KeySym = KeySym(0x10006f3); +pub const SYM_Farsi_4: KeySym = KeySym(0x10006f4); +pub const SYM_Farsi_5: KeySym = KeySym(0x10006f5); +pub const SYM_Farsi_6: KeySym = KeySym(0x10006f6); +pub const SYM_Farsi_7: KeySym = KeySym(0x10006f7); +pub const SYM_Farsi_8: KeySym = KeySym(0x10006f8); +pub const SYM_Farsi_9: KeySym = KeySym(0x10006f9); +pub const SYM_Arabic_percent: KeySym = KeySym(0x100066a); +pub const SYM_Arabic_superscript_alef: KeySym = KeySym(0x1000670); +pub const SYM_Arabic_tteh: KeySym = KeySym(0x1000679); +pub const SYM_Arabic_peh: KeySym = KeySym(0x100067e); +pub const SYM_Arabic_tcheh: KeySym = KeySym(0x1000686); +pub const SYM_Arabic_ddal: KeySym = KeySym(0x1000688); +pub const SYM_Arabic_rreh: KeySym = KeySym(0x1000691); +pub const SYM_Arabic_comma: KeySym = KeySym(0x05ac); +pub const SYM_Arabic_fullstop: KeySym = KeySym(0x10006d4); +pub const SYM_Arabic_0: KeySym = KeySym(0x1000660); +pub const SYM_Arabic_1: KeySym = KeySym(0x1000661); +pub const SYM_Arabic_2: KeySym = KeySym(0x1000662); +pub const SYM_Arabic_3: KeySym = KeySym(0x1000663); +pub const SYM_Arabic_4: KeySym = KeySym(0x1000664); +pub const SYM_Arabic_5: KeySym = KeySym(0x1000665); +pub const SYM_Arabic_6: KeySym = KeySym(0x1000666); +pub const SYM_Arabic_7: KeySym = KeySym(0x1000667); +pub const SYM_Arabic_8: KeySym = KeySym(0x1000668); +pub const SYM_Arabic_9: KeySym = KeySym(0x1000669); +pub const SYM_Arabic_semicolon: KeySym = KeySym(0x05bb); +pub const SYM_Arabic_question_mark: KeySym = KeySym(0x05bf); +pub const SYM_Arabic_hamza: KeySym = KeySym(0x05c1); +pub const SYM_Arabic_maddaonalef: KeySym = KeySym(0x05c2); +pub const SYM_Arabic_hamzaonalef: KeySym = KeySym(0x05c3); +pub const SYM_Arabic_hamzaonwaw: KeySym = KeySym(0x05c4); +pub const SYM_Arabic_hamzaunderalef: KeySym = KeySym(0x05c5); +pub const SYM_Arabic_hamzaonyeh: KeySym = KeySym(0x05c6); +pub const SYM_Arabic_alef: KeySym = KeySym(0x05c7); +pub const SYM_Arabic_beh: KeySym = KeySym(0x05c8); +pub const SYM_Arabic_tehmarbuta: KeySym = KeySym(0x05c9); +pub const SYM_Arabic_teh: KeySym = KeySym(0x05ca); +pub const SYM_Arabic_theh: KeySym = KeySym(0x05cb); +pub const SYM_Arabic_jeem: KeySym = KeySym(0x05cc); +pub const SYM_Arabic_hah: KeySym = KeySym(0x05cd); +pub const SYM_Arabic_khah: KeySym = KeySym(0x05ce); +pub const SYM_Arabic_dal: KeySym = KeySym(0x05cf); +pub const SYM_Arabic_thal: KeySym = KeySym(0x05d0); +pub const SYM_Arabic_ra: KeySym = KeySym(0x05d1); +pub const SYM_Arabic_zain: KeySym = KeySym(0x05d2); +pub const SYM_Arabic_seen: KeySym = KeySym(0x05d3); +pub const SYM_Arabic_sheen: KeySym = KeySym(0x05d4); +pub const SYM_Arabic_sad: KeySym = KeySym(0x05d5); +pub const SYM_Arabic_dad: KeySym = KeySym(0x05d6); +pub const SYM_Arabic_tah: KeySym = KeySym(0x05d7); +pub const SYM_Arabic_zah: KeySym = KeySym(0x05d8); +pub const SYM_Arabic_ain: KeySym = KeySym(0x05d9); +pub const SYM_Arabic_ghain: KeySym = KeySym(0x05da); +pub const SYM_Arabic_tatweel: KeySym = KeySym(0x05e0); +pub const SYM_Arabic_feh: KeySym = KeySym(0x05e1); +pub const SYM_Arabic_qaf: KeySym = KeySym(0x05e2); +pub const SYM_Arabic_kaf: KeySym = KeySym(0x05e3); +pub const SYM_Arabic_lam: KeySym = KeySym(0x05e4); +pub const SYM_Arabic_meem: KeySym = KeySym(0x05e5); +pub const SYM_Arabic_noon: KeySym = KeySym(0x05e6); +pub const SYM_Arabic_ha: KeySym = KeySym(0x05e7); +pub const SYM_Arabic_heh: KeySym = KeySym(0x05e7); +pub const SYM_Arabic_waw: KeySym = KeySym(0x05e8); +pub const SYM_Arabic_alefmaksura: KeySym = KeySym(0x05e9); +pub const SYM_Arabic_yeh: KeySym = KeySym(0x05ea); +pub const SYM_Arabic_fathatan: KeySym = KeySym(0x05eb); +pub const SYM_Arabic_dammatan: KeySym = KeySym(0x05ec); +pub const SYM_Arabic_kasratan: KeySym = KeySym(0x05ed); +pub const SYM_Arabic_fatha: KeySym = KeySym(0x05ee); +pub const SYM_Arabic_damma: KeySym = KeySym(0x05ef); +pub const SYM_Arabic_kasra: KeySym = KeySym(0x05f0); +pub const SYM_Arabic_shadda: KeySym = KeySym(0x05f1); +pub const SYM_Arabic_sukun: KeySym = KeySym(0x05f2); +pub const SYM_Arabic_madda_above: KeySym = KeySym(0x1000653); +pub const SYM_Arabic_hamza_above: KeySym = KeySym(0x1000654); +pub const SYM_Arabic_hamza_below: KeySym = KeySym(0x1000655); +pub const SYM_Arabic_jeh: KeySym = KeySym(0x1000698); +pub const SYM_Arabic_veh: KeySym = KeySym(0x10006a4); +pub const SYM_Arabic_keheh: KeySym = KeySym(0x10006a9); +pub const SYM_Arabic_gaf: KeySym = KeySym(0x10006af); +pub const SYM_Arabic_noon_ghunna: KeySym = KeySym(0x10006ba); +pub const SYM_Arabic_heh_doachashmee: KeySym = KeySym(0x10006be); +pub const SYM_Farsi_yeh: KeySym = KeySym(0x10006cc); +pub const SYM_Arabic_farsi_yeh: KeySym = KeySym(0x10006cc); +pub const SYM_Arabic_yeh_baree: KeySym = KeySym(0x10006d2); +pub const SYM_Arabic_heh_goal: KeySym = KeySym(0x10006c1); +pub const SYM_Arabic_switch: KeySym = KeySym(0xff7e); +pub const SYM_Cyrillic_GHE_bar: KeySym = KeySym(0x1000492); +pub const SYM_Cyrillic_ghe_bar: KeySym = KeySym(0x1000493); +pub const SYM_Cyrillic_ZHE_descender: KeySym = KeySym(0x1000496); +pub const SYM_Cyrillic_zhe_descender: KeySym = KeySym(0x1000497); +pub const SYM_Cyrillic_KA_descender: KeySym = KeySym(0x100049a); +pub const SYM_Cyrillic_ka_descender: KeySym = KeySym(0x100049b); +pub const SYM_Cyrillic_KA_vertstroke: KeySym = KeySym(0x100049c); +pub const SYM_Cyrillic_ka_vertstroke: KeySym = KeySym(0x100049d); +pub const SYM_Cyrillic_EN_descender: KeySym = KeySym(0x10004a2); +pub const SYM_Cyrillic_en_descender: KeySym = KeySym(0x10004a3); +pub const SYM_Cyrillic_U_straight: KeySym = KeySym(0x10004ae); +pub const SYM_Cyrillic_u_straight: KeySym = KeySym(0x10004af); +pub const SYM_Cyrillic_U_straight_bar: KeySym = KeySym(0x10004b0); +pub const SYM_Cyrillic_u_straight_bar: KeySym = KeySym(0x10004b1); +pub const SYM_Cyrillic_HA_descender: KeySym = KeySym(0x10004b2); +pub const SYM_Cyrillic_ha_descender: KeySym = KeySym(0x10004b3); +pub const SYM_Cyrillic_CHE_descender: KeySym = KeySym(0x10004b6); +pub const SYM_Cyrillic_che_descender: KeySym = KeySym(0x10004b7); +pub const SYM_Cyrillic_CHE_vertstroke: KeySym = KeySym(0x10004b8); +pub const SYM_Cyrillic_che_vertstroke: KeySym = KeySym(0x10004b9); +pub const SYM_Cyrillic_SHHA: KeySym = KeySym(0x10004ba); +pub const SYM_Cyrillic_shha: KeySym = KeySym(0x10004bb); +pub const SYM_Cyrillic_SCHWA: KeySym = KeySym(0x10004d8); +pub const SYM_Cyrillic_schwa: KeySym = KeySym(0x10004d9); +pub const SYM_Cyrillic_I_macron: KeySym = KeySym(0x10004e2); +pub const SYM_Cyrillic_i_macron: KeySym = KeySym(0x10004e3); +pub const SYM_Cyrillic_O_bar: KeySym = KeySym(0x10004e8); +pub const SYM_Cyrillic_o_bar: KeySym = KeySym(0x10004e9); +pub const SYM_Cyrillic_U_macron: KeySym = KeySym(0x10004ee); +pub const SYM_Cyrillic_u_macron: KeySym = KeySym(0x10004ef); +pub const SYM_Serbian_dje: KeySym = KeySym(0x06a1); +pub const SYM_Macedonia_gje: KeySym = KeySym(0x06a2); +pub const SYM_Cyrillic_io: KeySym = KeySym(0x06a3); +pub const SYM_Ukrainian_ie: KeySym = KeySym(0x06a4); +pub const SYM_Ukranian_je: KeySym = KeySym(0x06a4); +pub const SYM_Macedonia_dse: KeySym = KeySym(0x06a5); +pub const SYM_Ukrainian_i: KeySym = KeySym(0x06a6); +pub const SYM_Ukranian_i: KeySym = KeySym(0x06a6); +pub const SYM_Ukrainian_yi: KeySym = KeySym(0x06a7); +pub const SYM_Ukranian_yi: KeySym = KeySym(0x06a7); +pub const SYM_Cyrillic_je: KeySym = KeySym(0x06a8); +pub const SYM_Serbian_je: KeySym = KeySym(0x06a8); +pub const SYM_Cyrillic_lje: KeySym = KeySym(0x06a9); +pub const SYM_Serbian_lje: KeySym = KeySym(0x06a9); +pub const SYM_Cyrillic_nje: KeySym = KeySym(0x06aa); +pub const SYM_Serbian_nje: KeySym = KeySym(0x06aa); +pub const SYM_Serbian_tshe: KeySym = KeySym(0x06ab); +pub const SYM_Macedonia_kje: KeySym = KeySym(0x06ac); +pub const SYM_Ukrainian_ghe_with_upturn: KeySym = KeySym(0x06ad); +pub const SYM_Byelorussian_shortu: KeySym = KeySym(0x06ae); +pub const SYM_Cyrillic_dzhe: KeySym = KeySym(0x06af); +pub const SYM_Serbian_dze: KeySym = KeySym(0x06af); +pub const SYM_numerosign: KeySym = KeySym(0x06b0); +pub const SYM_Serbian_DJE: KeySym = KeySym(0x06b1); +pub const SYM_Macedonia_GJE: KeySym = KeySym(0x06b2); +pub const SYM_Cyrillic_IO: KeySym = KeySym(0x06b3); +pub const SYM_Ukrainian_IE: KeySym = KeySym(0x06b4); +pub const SYM_Ukranian_JE: KeySym = KeySym(0x06b4); +pub const SYM_Macedonia_DSE: KeySym = KeySym(0x06b5); +pub const SYM_Ukrainian_I: KeySym = KeySym(0x06b6); +pub const SYM_Ukranian_I: KeySym = KeySym(0x06b6); +pub const SYM_Ukrainian_YI: KeySym = KeySym(0x06b7); +pub const SYM_Ukranian_YI: KeySym = KeySym(0x06b7); +pub const SYM_Cyrillic_JE: KeySym = KeySym(0x06b8); +pub const SYM_Serbian_JE: KeySym = KeySym(0x06b8); +pub const SYM_Cyrillic_LJE: KeySym = KeySym(0x06b9); +pub const SYM_Serbian_LJE: KeySym = KeySym(0x06b9); +pub const SYM_Cyrillic_NJE: KeySym = KeySym(0x06ba); +pub const SYM_Serbian_NJE: KeySym = KeySym(0x06ba); +pub const SYM_Serbian_TSHE: KeySym = KeySym(0x06bb); +pub const SYM_Macedonia_KJE: KeySym = KeySym(0x06bc); +pub const SYM_Ukrainian_GHE_WITH_UPTURN: KeySym = KeySym(0x06bd); +pub const SYM_Byelorussian_SHORTU: KeySym = KeySym(0x06be); +pub const SYM_Cyrillic_DZHE: KeySym = KeySym(0x06bf); +pub const SYM_Serbian_DZE: KeySym = KeySym(0x06bf); +pub const SYM_Cyrillic_yu: KeySym = KeySym(0x06c0); +pub const SYM_Cyrillic_a: KeySym = KeySym(0x06c1); +pub const SYM_Cyrillic_be: KeySym = KeySym(0x06c2); +pub const SYM_Cyrillic_tse: KeySym = KeySym(0x06c3); +pub const SYM_Cyrillic_de: KeySym = KeySym(0x06c4); +pub const SYM_Cyrillic_ie: KeySym = KeySym(0x06c5); +pub const SYM_Cyrillic_ef: KeySym = KeySym(0x06c6); +pub const SYM_Cyrillic_ghe: KeySym = KeySym(0x06c7); +pub const SYM_Cyrillic_ha: KeySym = KeySym(0x06c8); +pub const SYM_Cyrillic_i: KeySym = KeySym(0x06c9); +pub const SYM_Cyrillic_shorti: KeySym = KeySym(0x06ca); +pub const SYM_Cyrillic_ka: KeySym = KeySym(0x06cb); +pub const SYM_Cyrillic_el: KeySym = KeySym(0x06cc); +pub const SYM_Cyrillic_em: KeySym = KeySym(0x06cd); +pub const SYM_Cyrillic_en: KeySym = KeySym(0x06ce); +pub const SYM_Cyrillic_o: KeySym = KeySym(0x06cf); +pub const SYM_Cyrillic_pe: KeySym = KeySym(0x06d0); +pub const SYM_Cyrillic_ya: KeySym = KeySym(0x06d1); +pub const SYM_Cyrillic_er: KeySym = KeySym(0x06d2); +pub const SYM_Cyrillic_es: KeySym = KeySym(0x06d3); +pub const SYM_Cyrillic_te: KeySym = KeySym(0x06d4); +pub const SYM_Cyrillic_u: KeySym = KeySym(0x06d5); +pub const SYM_Cyrillic_zhe: KeySym = KeySym(0x06d6); +pub const SYM_Cyrillic_ve: KeySym = KeySym(0x06d7); +pub const SYM_Cyrillic_softsign: KeySym = KeySym(0x06d8); +pub const SYM_Cyrillic_yeru: KeySym = KeySym(0x06d9); +pub const SYM_Cyrillic_ze: KeySym = KeySym(0x06da); +pub const SYM_Cyrillic_sha: KeySym = KeySym(0x06db); +pub const SYM_Cyrillic_e: KeySym = KeySym(0x06dc); +pub const SYM_Cyrillic_shcha: KeySym = KeySym(0x06dd); +pub const SYM_Cyrillic_che: KeySym = KeySym(0x06de); +pub const SYM_Cyrillic_hardsign: KeySym = KeySym(0x06df); +pub const SYM_Cyrillic_YU: KeySym = KeySym(0x06e0); +pub const SYM_Cyrillic_A: KeySym = KeySym(0x06e1); +pub const SYM_Cyrillic_BE: KeySym = KeySym(0x06e2); +pub const SYM_Cyrillic_TSE: KeySym = KeySym(0x06e3); +pub const SYM_Cyrillic_DE: KeySym = KeySym(0x06e4); +pub const SYM_Cyrillic_IE: KeySym = KeySym(0x06e5); +pub const SYM_Cyrillic_EF: KeySym = KeySym(0x06e6); +pub const SYM_Cyrillic_GHE: KeySym = KeySym(0x06e7); +pub const SYM_Cyrillic_HA: KeySym = KeySym(0x06e8); +pub const SYM_Cyrillic_I: KeySym = KeySym(0x06e9); +pub const SYM_Cyrillic_SHORTI: KeySym = KeySym(0x06ea); +pub const SYM_Cyrillic_KA: KeySym = KeySym(0x06eb); +pub const SYM_Cyrillic_EL: KeySym = KeySym(0x06ec); +pub const SYM_Cyrillic_EM: KeySym = KeySym(0x06ed); +pub const SYM_Cyrillic_EN: KeySym = KeySym(0x06ee); +pub const SYM_Cyrillic_O: KeySym = KeySym(0x06ef); +pub const SYM_Cyrillic_PE: KeySym = KeySym(0x06f0); +pub const SYM_Cyrillic_YA: KeySym = KeySym(0x06f1); +pub const SYM_Cyrillic_ER: KeySym = KeySym(0x06f2); +pub const SYM_Cyrillic_ES: KeySym = KeySym(0x06f3); +pub const SYM_Cyrillic_TE: KeySym = KeySym(0x06f4); +pub const SYM_Cyrillic_U: KeySym = KeySym(0x06f5); +pub const SYM_Cyrillic_ZHE: KeySym = KeySym(0x06f6); +pub const SYM_Cyrillic_VE: KeySym = KeySym(0x06f7); +pub const SYM_Cyrillic_SOFTSIGN: KeySym = KeySym(0x06f8); +pub const SYM_Cyrillic_YERU: KeySym = KeySym(0x06f9); +pub const SYM_Cyrillic_ZE: KeySym = KeySym(0x06fa); +pub const SYM_Cyrillic_SHA: KeySym = KeySym(0x06fb); +pub const SYM_Cyrillic_E: KeySym = KeySym(0x06fc); +pub const SYM_Cyrillic_SHCHA: KeySym = KeySym(0x06fd); +pub const SYM_Cyrillic_CHE: KeySym = KeySym(0x06fe); +pub const SYM_Cyrillic_HARDSIGN: KeySym = KeySym(0x06ff); +pub const SYM_Greek_ALPHAaccent: KeySym = KeySym(0x07a1); +pub const SYM_Greek_EPSILONaccent: KeySym = KeySym(0x07a2); +pub const SYM_Greek_ETAaccent: KeySym = KeySym(0x07a3); +pub const SYM_Greek_IOTAaccent: KeySym = KeySym(0x07a4); +pub const SYM_Greek_IOTAdieresis: KeySym = KeySym(0x07a5); +pub const SYM_Greek_IOTAdiaeresis: KeySym = KeySym(0x07a5); +pub const SYM_Greek_OMICRONaccent: KeySym = KeySym(0x07a7); +pub const SYM_Greek_UPSILONaccent: KeySym = KeySym(0x07a8); +pub const SYM_Greek_UPSILONdieresis: KeySym = KeySym(0x07a9); +pub const SYM_Greek_OMEGAaccent: KeySym = KeySym(0x07ab); +pub const SYM_Greek_accentdieresis: KeySym = KeySym(0x07ae); +pub const SYM_Greek_horizbar: KeySym = KeySym(0x07af); +pub const SYM_Greek_alphaaccent: KeySym = KeySym(0x07b1); +pub const SYM_Greek_epsilonaccent: KeySym = KeySym(0x07b2); +pub const SYM_Greek_etaaccent: KeySym = KeySym(0x07b3); +pub const SYM_Greek_iotaaccent: KeySym = KeySym(0x07b4); +pub const SYM_Greek_iotadieresis: KeySym = KeySym(0x07b5); +pub const SYM_Greek_iotaaccentdieresis: KeySym = KeySym(0x07b6); +pub const SYM_Greek_omicronaccent: KeySym = KeySym(0x07b7); +pub const SYM_Greek_upsilonaccent: KeySym = KeySym(0x07b8); +pub const SYM_Greek_upsilondieresis: KeySym = KeySym(0x07b9); +pub const SYM_Greek_upsilonaccentdieresis: KeySym = KeySym(0x07ba); +pub const SYM_Greek_omegaaccent: KeySym = KeySym(0x07bb); +pub const SYM_Greek_ALPHA: KeySym = KeySym(0x07c1); +pub const SYM_Greek_BETA: KeySym = KeySym(0x07c2); +pub const SYM_Greek_GAMMA: KeySym = KeySym(0x07c3); +pub const SYM_Greek_DELTA: KeySym = KeySym(0x07c4); +pub const SYM_Greek_EPSILON: KeySym = KeySym(0x07c5); +pub const SYM_Greek_ZETA: KeySym = KeySym(0x07c6); +pub const SYM_Greek_ETA: KeySym = KeySym(0x07c7); +pub const SYM_Greek_THETA: KeySym = KeySym(0x07c8); +pub const SYM_Greek_IOTA: KeySym = KeySym(0x07c9); +pub const SYM_Greek_KAPPA: KeySym = KeySym(0x07ca); +pub const SYM_Greek_LAMDA: KeySym = KeySym(0x07cb); +pub const SYM_Greek_LAMBDA: KeySym = KeySym(0x07cb); +pub const SYM_Greek_MU: KeySym = KeySym(0x07cc); +pub const SYM_Greek_NU: KeySym = KeySym(0x07cd); +pub const SYM_Greek_XI: KeySym = KeySym(0x07ce); +pub const SYM_Greek_OMICRON: KeySym = KeySym(0x07cf); +pub const SYM_Greek_PI: KeySym = KeySym(0x07d0); +pub const SYM_Greek_RHO: KeySym = KeySym(0x07d1); +pub const SYM_Greek_SIGMA: KeySym = KeySym(0x07d2); +pub const SYM_Greek_TAU: KeySym = KeySym(0x07d4); +pub const SYM_Greek_UPSILON: KeySym = KeySym(0x07d5); +pub const SYM_Greek_PHI: KeySym = KeySym(0x07d6); +pub const SYM_Greek_CHI: KeySym = KeySym(0x07d7); +pub const SYM_Greek_PSI: KeySym = KeySym(0x07d8); +pub const SYM_Greek_OMEGA: KeySym = KeySym(0x07d9); +pub const SYM_Greek_alpha: KeySym = KeySym(0x07e1); +pub const SYM_Greek_beta: KeySym = KeySym(0x07e2); +pub const SYM_Greek_gamma: KeySym = KeySym(0x07e3); +pub const SYM_Greek_delta: KeySym = KeySym(0x07e4); +pub const SYM_Greek_epsilon: KeySym = KeySym(0x07e5); +pub const SYM_Greek_zeta: KeySym = KeySym(0x07e6); +pub const SYM_Greek_eta: KeySym = KeySym(0x07e7); +pub const SYM_Greek_theta: KeySym = KeySym(0x07e8); +pub const SYM_Greek_iota: KeySym = KeySym(0x07e9); +pub const SYM_Greek_kappa: KeySym = KeySym(0x07ea); +pub const SYM_Greek_lamda: KeySym = KeySym(0x07eb); +pub const SYM_Greek_lambda: KeySym = KeySym(0x07eb); +pub const SYM_Greek_mu: KeySym = KeySym(0x07ec); +pub const SYM_Greek_nu: KeySym = KeySym(0x07ed); +pub const SYM_Greek_xi: KeySym = KeySym(0x07ee); +pub const SYM_Greek_omicron: KeySym = KeySym(0x07ef); +pub const SYM_Greek_pi: KeySym = KeySym(0x07f0); +pub const SYM_Greek_rho: KeySym = KeySym(0x07f1); +pub const SYM_Greek_sigma: KeySym = KeySym(0x07f2); +pub const SYM_Greek_finalsmallsigma: KeySym = KeySym(0x07f3); +pub const SYM_Greek_tau: KeySym = KeySym(0x07f4); +pub const SYM_Greek_upsilon: KeySym = KeySym(0x07f5); +pub const SYM_Greek_phi: KeySym = KeySym(0x07f6); +pub const SYM_Greek_chi: KeySym = KeySym(0x07f7); +pub const SYM_Greek_psi: KeySym = KeySym(0x07f8); +pub const SYM_Greek_omega: KeySym = KeySym(0x07f9); +pub const SYM_Greek_switch: KeySym = KeySym(0xff7e); +pub const SYM_leftradical: KeySym = KeySym(0x08a1); +pub const SYM_topleftradical: KeySym = KeySym(0x08a2); +pub const SYM_horizconnector: KeySym = KeySym(0x08a3); +pub const SYM_topintegral: KeySym = KeySym(0x08a4); +pub const SYM_botintegral: KeySym = KeySym(0x08a5); +pub const SYM_vertconnector: KeySym = KeySym(0x08a6); +pub const SYM_topleftsqbracket: KeySym = KeySym(0x08a7); +pub const SYM_botleftsqbracket: KeySym = KeySym(0x08a8); +pub const SYM_toprightsqbracket: KeySym = KeySym(0x08a9); +pub const SYM_botrightsqbracket: KeySym = KeySym(0x08aa); +pub const SYM_topleftparens: KeySym = KeySym(0x08ab); +pub const SYM_botleftparens: KeySym = KeySym(0x08ac); +pub const SYM_toprightparens: KeySym = KeySym(0x08ad); +pub const SYM_botrightparens: KeySym = KeySym(0x08ae); +pub const SYM_leftmiddlecurlybrace: KeySym = KeySym(0x08af); +pub const SYM_rightmiddlecurlybrace: KeySym = KeySym(0x08b0); +pub const SYM_topleftsummation: KeySym = KeySym(0x08b1); +pub const SYM_botleftsummation: KeySym = KeySym(0x08b2); +pub const SYM_topvertsummationconnector: KeySym = KeySym(0x08b3); +pub const SYM_botvertsummationconnector: KeySym = KeySym(0x08b4); +pub const SYM_toprightsummation: KeySym = KeySym(0x08b5); +pub const SYM_botrightsummation: KeySym = KeySym(0x08b6); +pub const SYM_rightmiddlesummation: KeySym = KeySym(0x08b7); +pub const SYM_lessthanequal: KeySym = KeySym(0x08bc); +pub const SYM_notequal: KeySym = KeySym(0x08bd); +pub const SYM_greaterthanequal: KeySym = KeySym(0x08be); +pub const SYM_integral: KeySym = KeySym(0x08bf); +pub const SYM_therefore: KeySym = KeySym(0x08c0); +pub const SYM_variation: KeySym = KeySym(0x08c1); +pub const SYM_infinity: KeySym = KeySym(0x08c2); +pub const SYM_nabla: KeySym = KeySym(0x08c5); +pub const SYM_approximate: KeySym = KeySym(0x08c8); +pub const SYM_similarequal: KeySym = KeySym(0x08c9); +pub const SYM_ifonlyif: KeySym = KeySym(0x08cd); +pub const SYM_implies: KeySym = KeySym(0x08ce); +pub const SYM_identical: KeySym = KeySym(0x08cf); +pub const SYM_radical: KeySym = KeySym(0x08d6); +pub const SYM_includedin: KeySym = KeySym(0x08da); +pub const SYM_includes: KeySym = KeySym(0x08db); +pub const SYM_intersection: KeySym = KeySym(0x08dc); +pub const SYM_union: KeySym = KeySym(0x08dd); +pub const SYM_logicaland: KeySym = KeySym(0x08de); +pub const SYM_logicalor: KeySym = KeySym(0x08df); +pub const SYM_partialderivative: KeySym = KeySym(0x08ef); +pub const SYM_function: KeySym = KeySym(0x08f6); +pub const SYM_leftarrow: KeySym = KeySym(0x08fb); +pub const SYM_uparrow: KeySym = KeySym(0x08fc); +pub const SYM_rightarrow: KeySym = KeySym(0x08fd); +pub const SYM_downarrow: KeySym = KeySym(0x08fe); +pub const SYM_blank: KeySym = KeySym(0x09df); +pub const SYM_soliddiamond: KeySym = KeySym(0x09e0); +pub const SYM_checkerboard: KeySym = KeySym(0x09e1); +pub const SYM_ht: KeySym = KeySym(0x09e2); +pub const SYM_ff: KeySym = KeySym(0x09e3); +pub const SYM_cr: KeySym = KeySym(0x09e4); +pub const SYM_lf: KeySym = KeySym(0x09e5); +pub const SYM_nl: KeySym = KeySym(0x09e8); +pub const SYM_vt: KeySym = KeySym(0x09e9); +pub const SYM_lowrightcorner: KeySym = KeySym(0x09ea); +pub const SYM_uprightcorner: KeySym = KeySym(0x09eb); +pub const SYM_upleftcorner: KeySym = KeySym(0x09ec); +pub const SYM_lowleftcorner: KeySym = KeySym(0x09ed); +pub const SYM_crossinglines: KeySym = KeySym(0x09ee); +pub const SYM_horizlinescan1: KeySym = KeySym(0x09ef); +pub const SYM_horizlinescan3: KeySym = KeySym(0x09f0); +pub const SYM_horizlinescan5: KeySym = KeySym(0x09f1); +pub const SYM_horizlinescan7: KeySym = KeySym(0x09f2); +pub const SYM_horizlinescan9: KeySym = KeySym(0x09f3); +pub const SYM_leftt: KeySym = KeySym(0x09f4); +pub const SYM_rightt: KeySym = KeySym(0x09f5); +pub const SYM_bott: KeySym = KeySym(0x09f6); +pub const SYM_topt: KeySym = KeySym(0x09f7); +pub const SYM_vertbar: KeySym = KeySym(0x09f8); +pub const SYM_emspace: KeySym = KeySym(0x0aa1); +pub const SYM_enspace: KeySym = KeySym(0x0aa2); +pub const SYM_em3space: KeySym = KeySym(0x0aa3); +pub const SYM_em4space: KeySym = KeySym(0x0aa4); +pub const SYM_digitspace: KeySym = KeySym(0x0aa5); +pub const SYM_punctspace: KeySym = KeySym(0x0aa6); +pub const SYM_thinspace: KeySym = KeySym(0x0aa7); +pub const SYM_hairspace: KeySym = KeySym(0x0aa8); +pub const SYM_emdash: KeySym = KeySym(0x0aa9); +pub const SYM_endash: KeySym = KeySym(0x0aaa); +pub const SYM_signifblank: KeySym = KeySym(0x0aac); +pub const SYM_ellipsis: KeySym = KeySym(0x0aae); +pub const SYM_doubbaselinedot: KeySym = KeySym(0x0aaf); +pub const SYM_onethird: KeySym = KeySym(0x0ab0); +pub const SYM_twothirds: KeySym = KeySym(0x0ab1); +pub const SYM_onefifth: KeySym = KeySym(0x0ab2); +pub const SYM_twofifths: KeySym = KeySym(0x0ab3); +pub const SYM_threefifths: KeySym = KeySym(0x0ab4); +pub const SYM_fourfifths: KeySym = KeySym(0x0ab5); +pub const SYM_onesixth: KeySym = KeySym(0x0ab6); +pub const SYM_fivesixths: KeySym = KeySym(0x0ab7); +pub const SYM_careof: KeySym = KeySym(0x0ab8); +pub const SYM_figdash: KeySym = KeySym(0x0abb); +pub const SYM_leftanglebracket: KeySym = KeySym(0x0abc); +pub const SYM_decimalpoint: KeySym = KeySym(0x0abd); +pub const SYM_rightanglebracket: KeySym = KeySym(0x0abe); +pub const SYM_marker: KeySym = KeySym(0x0abf); +pub const SYM_oneeighth: KeySym = KeySym(0x0ac3); +pub const SYM_threeeighths: KeySym = KeySym(0x0ac4); +pub const SYM_fiveeighths: KeySym = KeySym(0x0ac5); +pub const SYM_seveneighths: KeySym = KeySym(0x0ac6); +pub const SYM_trademark: KeySym = KeySym(0x0ac9); +pub const SYM_signaturemark: KeySym = KeySym(0x0aca); +pub const SYM_trademarkincircle: KeySym = KeySym(0x0acb); +pub const SYM_leftopentriangle: KeySym = KeySym(0x0acc); +pub const SYM_rightopentriangle: KeySym = KeySym(0x0acd); +pub const SYM_emopencircle: KeySym = KeySym(0x0ace); +pub const SYM_emopenrectangle: KeySym = KeySym(0x0acf); +pub const SYM_leftsinglequotemark: KeySym = KeySym(0x0ad0); +pub const SYM_rightsinglequotemark: KeySym = KeySym(0x0ad1); +pub const SYM_leftdoublequotemark: KeySym = KeySym(0x0ad2); +pub const SYM_rightdoublequotemark: KeySym = KeySym(0x0ad3); +pub const SYM_prescription: KeySym = KeySym(0x0ad4); +pub const SYM_permille: KeySym = KeySym(0x0ad5); +pub const SYM_minutes: KeySym = KeySym(0x0ad6); +pub const SYM_seconds: KeySym = KeySym(0x0ad7); +pub const SYM_latincross: KeySym = KeySym(0x0ad9); +pub const SYM_hexagram: KeySym = KeySym(0x0ada); +pub const SYM_filledrectbullet: KeySym = KeySym(0x0adb); +pub const SYM_filledlefttribullet: KeySym = KeySym(0x0adc); +pub const SYM_filledrighttribullet: KeySym = KeySym(0x0add); +pub const SYM_emfilledcircle: KeySym = KeySym(0x0ade); +pub const SYM_emfilledrect: KeySym = KeySym(0x0adf); +pub const SYM_enopencircbullet: KeySym = KeySym(0x0ae0); +pub const SYM_enopensquarebullet: KeySym = KeySym(0x0ae1); +pub const SYM_openrectbullet: KeySym = KeySym(0x0ae2); +pub const SYM_opentribulletup: KeySym = KeySym(0x0ae3); +pub const SYM_opentribulletdown: KeySym = KeySym(0x0ae4); +pub const SYM_openstar: KeySym = KeySym(0x0ae5); +pub const SYM_enfilledcircbullet: KeySym = KeySym(0x0ae6); +pub const SYM_enfilledsqbullet: KeySym = KeySym(0x0ae7); +pub const SYM_filledtribulletup: KeySym = KeySym(0x0ae8); +pub const SYM_filledtribulletdown: KeySym = KeySym(0x0ae9); +pub const SYM_leftpointer: KeySym = KeySym(0x0aea); +pub const SYM_rightpointer: KeySym = KeySym(0x0aeb); +pub const SYM_club: KeySym = KeySym(0x0aec); +pub const SYM_diamond: KeySym = KeySym(0x0aed); +pub const SYM_heart: KeySym = KeySym(0x0aee); +pub const SYM_maltesecross: KeySym = KeySym(0x0af0); +pub const SYM_dagger: KeySym = KeySym(0x0af1); +pub const SYM_doubledagger: KeySym = KeySym(0x0af2); +pub const SYM_checkmark: KeySym = KeySym(0x0af3); +pub const SYM_ballotcross: KeySym = KeySym(0x0af4); +pub const SYM_musicalsharp: KeySym = KeySym(0x0af5); +pub const SYM_musicalflat: KeySym = KeySym(0x0af6); +pub const SYM_malesymbol: KeySym = KeySym(0x0af7); +pub const SYM_femalesymbol: KeySym = KeySym(0x0af8); +pub const SYM_telephone: KeySym = KeySym(0x0af9); +pub const SYM_telephonerecorder: KeySym = KeySym(0x0afa); +pub const SYM_phonographcopyright: KeySym = KeySym(0x0afb); +pub const SYM_caret: KeySym = KeySym(0x0afc); +pub const SYM_singlelowquotemark: KeySym = KeySym(0x0afd); +pub const SYM_doublelowquotemark: KeySym = KeySym(0x0afe); +pub const SYM_cursor: KeySym = KeySym(0x0aff); +pub const SYM_leftcaret: KeySym = KeySym(0x0ba3); +pub const SYM_rightcaret: KeySym = KeySym(0x0ba6); +pub const SYM_downcaret: KeySym = KeySym(0x0ba8); +pub const SYM_upcaret: KeySym = KeySym(0x0ba9); +pub const SYM_overbar: KeySym = KeySym(0x0bc0); +pub const SYM_downtack: KeySym = KeySym(0x0bc2); +pub const SYM_upshoe: KeySym = KeySym(0x0bc3); +pub const SYM_downstile: KeySym = KeySym(0x0bc4); +pub const SYM_underbar: KeySym = KeySym(0x0bc6); +pub const SYM_jot: KeySym = KeySym(0x0bca); +pub const SYM_quad: KeySym = KeySym(0x0bcc); +pub const SYM_uptack: KeySym = KeySym(0x0bce); +pub const SYM_circle: KeySym = KeySym(0x0bcf); +pub const SYM_upstile: KeySym = KeySym(0x0bd3); +pub const SYM_downshoe: KeySym = KeySym(0x0bd6); +pub const SYM_rightshoe: KeySym = KeySym(0x0bd8); +pub const SYM_leftshoe: KeySym = KeySym(0x0bda); +pub const SYM_lefttack: KeySym = KeySym(0x0bdc); +pub const SYM_righttack: KeySym = KeySym(0x0bfc); +pub const SYM_hebrew_doublelowline: KeySym = KeySym(0x0cdf); +pub const SYM_hebrew_aleph: KeySym = KeySym(0x0ce0); +pub const SYM_hebrew_bet: KeySym = KeySym(0x0ce1); +pub const SYM_hebrew_beth: KeySym = KeySym(0x0ce1); +pub const SYM_hebrew_gimel: KeySym = KeySym(0x0ce2); +pub const SYM_hebrew_gimmel: KeySym = KeySym(0x0ce2); +pub const SYM_hebrew_dalet: KeySym = KeySym(0x0ce3); +pub const SYM_hebrew_daleth: KeySym = KeySym(0x0ce3); +pub const SYM_hebrew_he: KeySym = KeySym(0x0ce4); +pub const SYM_hebrew_waw: KeySym = KeySym(0x0ce5); +pub const SYM_hebrew_zain: KeySym = KeySym(0x0ce6); +pub const SYM_hebrew_zayin: KeySym = KeySym(0x0ce6); +pub const SYM_hebrew_chet: KeySym = KeySym(0x0ce7); +pub const SYM_hebrew_het: KeySym = KeySym(0x0ce7); +pub const SYM_hebrew_tet: KeySym = KeySym(0x0ce8); +pub const SYM_hebrew_teth: KeySym = KeySym(0x0ce8); +pub const SYM_hebrew_yod: KeySym = KeySym(0x0ce9); +pub const SYM_hebrew_finalkaph: KeySym = KeySym(0x0cea); +pub const SYM_hebrew_kaph: KeySym = KeySym(0x0ceb); +pub const SYM_hebrew_lamed: KeySym = KeySym(0x0cec); +pub const SYM_hebrew_finalmem: KeySym = KeySym(0x0ced); +pub const SYM_hebrew_mem: KeySym = KeySym(0x0cee); +pub const SYM_hebrew_finalnun: KeySym = KeySym(0x0cef); +pub const SYM_hebrew_nun: KeySym = KeySym(0x0cf0); +pub const SYM_hebrew_samech: KeySym = KeySym(0x0cf1); +pub const SYM_hebrew_samekh: KeySym = KeySym(0x0cf1); +pub const SYM_hebrew_ayin: KeySym = KeySym(0x0cf2); +pub const SYM_hebrew_finalpe: KeySym = KeySym(0x0cf3); +pub const SYM_hebrew_pe: KeySym = KeySym(0x0cf4); +pub const SYM_hebrew_finalzade: KeySym = KeySym(0x0cf5); +pub const SYM_hebrew_finalzadi: KeySym = KeySym(0x0cf5); +pub const SYM_hebrew_zade: KeySym = KeySym(0x0cf6); +pub const SYM_hebrew_zadi: KeySym = KeySym(0x0cf6); +pub const SYM_hebrew_qoph: KeySym = KeySym(0x0cf7); +pub const SYM_hebrew_kuf: KeySym = KeySym(0x0cf7); +pub const SYM_hebrew_resh: KeySym = KeySym(0x0cf8); +pub const SYM_hebrew_shin: KeySym = KeySym(0x0cf9); +pub const SYM_hebrew_taw: KeySym = KeySym(0x0cfa); +pub const SYM_hebrew_taf: KeySym = KeySym(0x0cfa); +pub const SYM_Hebrew_switch: KeySym = KeySym(0xff7e); +pub const SYM_Thai_kokai: KeySym = KeySym(0x0da1); +pub const SYM_Thai_khokhai: KeySym = KeySym(0x0da2); +pub const SYM_Thai_khokhuat: KeySym = KeySym(0x0da3); +pub const SYM_Thai_khokhwai: KeySym = KeySym(0x0da4); +pub const SYM_Thai_khokhon: KeySym = KeySym(0x0da5); +pub const SYM_Thai_khorakhang: KeySym = KeySym(0x0da6); +pub const SYM_Thai_ngongu: KeySym = KeySym(0x0da7); +pub const SYM_Thai_chochan: KeySym = KeySym(0x0da8); +pub const SYM_Thai_choching: KeySym = KeySym(0x0da9); +pub const SYM_Thai_chochang: KeySym = KeySym(0x0daa); +pub const SYM_Thai_soso: KeySym = KeySym(0x0dab); +pub const SYM_Thai_chochoe: KeySym = KeySym(0x0dac); +pub const SYM_Thai_yoying: KeySym = KeySym(0x0dad); +pub const SYM_Thai_dochada: KeySym = KeySym(0x0dae); +pub const SYM_Thai_topatak: KeySym = KeySym(0x0daf); +pub const SYM_Thai_thothan: KeySym = KeySym(0x0db0); +pub const SYM_Thai_thonangmontho: KeySym = KeySym(0x0db1); +pub const SYM_Thai_thophuthao: KeySym = KeySym(0x0db2); +pub const SYM_Thai_nonen: KeySym = KeySym(0x0db3); +pub const SYM_Thai_dodek: KeySym = KeySym(0x0db4); +pub const SYM_Thai_totao: KeySym = KeySym(0x0db5); +pub const SYM_Thai_thothung: KeySym = KeySym(0x0db6); +pub const SYM_Thai_thothahan: KeySym = KeySym(0x0db7); +pub const SYM_Thai_thothong: KeySym = KeySym(0x0db8); +pub const SYM_Thai_nonu: KeySym = KeySym(0x0db9); +pub const SYM_Thai_bobaimai: KeySym = KeySym(0x0dba); +pub const SYM_Thai_popla: KeySym = KeySym(0x0dbb); +pub const SYM_Thai_phophung: KeySym = KeySym(0x0dbc); +pub const SYM_Thai_fofa: KeySym = KeySym(0x0dbd); +pub const SYM_Thai_phophan: KeySym = KeySym(0x0dbe); +pub const SYM_Thai_fofan: KeySym = KeySym(0x0dbf); +pub const SYM_Thai_phosamphao: KeySym = KeySym(0x0dc0); +pub const SYM_Thai_moma: KeySym = KeySym(0x0dc1); +pub const SYM_Thai_yoyak: KeySym = KeySym(0x0dc2); +pub const SYM_Thai_rorua: KeySym = KeySym(0x0dc3); +pub const SYM_Thai_ru: KeySym = KeySym(0x0dc4); +pub const SYM_Thai_loling: KeySym = KeySym(0x0dc5); +pub const SYM_Thai_lu: KeySym = KeySym(0x0dc6); +pub const SYM_Thai_wowaen: KeySym = KeySym(0x0dc7); +pub const SYM_Thai_sosala: KeySym = KeySym(0x0dc8); +pub const SYM_Thai_sorusi: KeySym = KeySym(0x0dc9); +pub const SYM_Thai_sosua: KeySym = KeySym(0x0dca); +pub const SYM_Thai_hohip: KeySym = KeySym(0x0dcb); +pub const SYM_Thai_lochula: KeySym = KeySym(0x0dcc); +pub const SYM_Thai_oang: KeySym = KeySym(0x0dcd); +pub const SYM_Thai_honokhuk: KeySym = KeySym(0x0dce); +pub const SYM_Thai_paiyannoi: KeySym = KeySym(0x0dcf); +pub const SYM_Thai_saraa: KeySym = KeySym(0x0dd0); +pub const SYM_Thai_maihanakat: KeySym = KeySym(0x0dd1); +pub const SYM_Thai_saraaa: KeySym = KeySym(0x0dd2); +pub const SYM_Thai_saraam: KeySym = KeySym(0x0dd3); +pub const SYM_Thai_sarai: KeySym = KeySym(0x0dd4); +pub const SYM_Thai_saraii: KeySym = KeySym(0x0dd5); +pub const SYM_Thai_saraue: KeySym = KeySym(0x0dd6); +pub const SYM_Thai_sarauee: KeySym = KeySym(0x0dd7); +pub const SYM_Thai_sarau: KeySym = KeySym(0x0dd8); +pub const SYM_Thai_sarauu: KeySym = KeySym(0x0dd9); +pub const SYM_Thai_phinthu: KeySym = KeySym(0x0dda); +pub const SYM_Thai_maihanakat_maitho: KeySym = KeySym(0x0dde); +pub const SYM_Thai_baht: KeySym = KeySym(0x0ddf); +pub const SYM_Thai_sarae: KeySym = KeySym(0x0de0); +pub const SYM_Thai_saraae: KeySym = KeySym(0x0de1); +pub const SYM_Thai_sarao: KeySym = KeySym(0x0de2); +pub const SYM_Thai_saraaimaimuan: KeySym = KeySym(0x0de3); +pub const SYM_Thai_saraaimaimalai: KeySym = KeySym(0x0de4); +pub const SYM_Thai_lakkhangyao: KeySym = KeySym(0x0de5); +pub const SYM_Thai_maiyamok: KeySym = KeySym(0x0de6); +pub const SYM_Thai_maitaikhu: KeySym = KeySym(0x0de7); +pub const SYM_Thai_maiek: KeySym = KeySym(0x0de8); +pub const SYM_Thai_maitho: KeySym = KeySym(0x0de9); +pub const SYM_Thai_maitri: KeySym = KeySym(0x0dea); +pub const SYM_Thai_maichattawa: KeySym = KeySym(0x0deb); +pub const SYM_Thai_thanthakhat: KeySym = KeySym(0x0dec); +pub const SYM_Thai_nikhahit: KeySym = KeySym(0x0ded); +pub const SYM_Thai_leksun: KeySym = KeySym(0x0df0); +pub const SYM_Thai_leknung: KeySym = KeySym(0x0df1); +pub const SYM_Thai_leksong: KeySym = KeySym(0x0df2); +pub const SYM_Thai_leksam: KeySym = KeySym(0x0df3); +pub const SYM_Thai_leksi: KeySym = KeySym(0x0df4); +pub const SYM_Thai_lekha: KeySym = KeySym(0x0df5); +pub const SYM_Thai_lekhok: KeySym = KeySym(0x0df6); +pub const SYM_Thai_lekchet: KeySym = KeySym(0x0df7); +pub const SYM_Thai_lekpaet: KeySym = KeySym(0x0df8); +pub const SYM_Thai_lekkao: KeySym = KeySym(0x0df9); +pub const SYM_Hangul: KeySym = KeySym(0xff31); +pub const SYM_Hangul_Start: KeySym = KeySym(0xff32); +pub const SYM_Hangul_End: KeySym = KeySym(0xff33); +pub const SYM_Hangul_Hanja: KeySym = KeySym(0xff34); +pub const SYM_Hangul_Jamo: KeySym = KeySym(0xff35); +pub const SYM_Hangul_Romaja: KeySym = KeySym(0xff36); +pub const SYM_Hangul_Codeinput: KeySym = KeySym(0xff37); +pub const SYM_Hangul_Jeonja: KeySym = KeySym(0xff38); +pub const SYM_Hangul_Banja: KeySym = KeySym(0xff39); +pub const SYM_Hangul_PreHanja: KeySym = KeySym(0xff3a); +pub const SYM_Hangul_PostHanja: KeySym = KeySym(0xff3b); +pub const SYM_Hangul_SingleCandidate: KeySym = KeySym(0xff3c); +pub const SYM_Hangul_MultipleCandidate: KeySym = KeySym(0xff3d); +pub const SYM_Hangul_PreviousCandidate: KeySym = KeySym(0xff3e); +pub const SYM_Hangul_Special: KeySym = KeySym(0xff3f); +pub const SYM_Hangul_switch: KeySym = KeySym(0xff7e); +pub const SYM_Hangul_Kiyeog: KeySym = KeySym(0x0ea1); +pub const SYM_Hangul_SsangKiyeog: KeySym = KeySym(0x0ea2); +pub const SYM_Hangul_KiyeogSios: KeySym = KeySym(0x0ea3); +pub const SYM_Hangul_Nieun: KeySym = KeySym(0x0ea4); +pub const SYM_Hangul_NieunJieuj: KeySym = KeySym(0x0ea5); +pub const SYM_Hangul_NieunHieuh: KeySym = KeySym(0x0ea6); +pub const SYM_Hangul_Dikeud: KeySym = KeySym(0x0ea7); +pub const SYM_Hangul_SsangDikeud: KeySym = KeySym(0x0ea8); +pub const SYM_Hangul_Rieul: KeySym = KeySym(0x0ea9); +pub const SYM_Hangul_RieulKiyeog: KeySym = KeySym(0x0eaa); +pub const SYM_Hangul_RieulMieum: KeySym = KeySym(0x0eab); +pub const SYM_Hangul_RieulPieub: KeySym = KeySym(0x0eac); +pub const SYM_Hangul_RieulSios: KeySym = KeySym(0x0ead); +pub const SYM_Hangul_RieulTieut: KeySym = KeySym(0x0eae); +pub const SYM_Hangul_RieulPhieuf: KeySym = KeySym(0x0eaf); +pub const SYM_Hangul_RieulHieuh: KeySym = KeySym(0x0eb0); +pub const SYM_Hangul_Mieum: KeySym = KeySym(0x0eb1); +pub const SYM_Hangul_Pieub: KeySym = KeySym(0x0eb2); +pub const SYM_Hangul_SsangPieub: KeySym = KeySym(0x0eb3); +pub const SYM_Hangul_PieubSios: KeySym = KeySym(0x0eb4); +pub const SYM_Hangul_Sios: KeySym = KeySym(0x0eb5); +pub const SYM_Hangul_SsangSios: KeySym = KeySym(0x0eb6); +pub const SYM_Hangul_Ieung: KeySym = KeySym(0x0eb7); +pub const SYM_Hangul_Jieuj: KeySym = KeySym(0x0eb8); +pub const SYM_Hangul_SsangJieuj: KeySym = KeySym(0x0eb9); +pub const SYM_Hangul_Cieuc: KeySym = KeySym(0x0eba); +pub const SYM_Hangul_Khieuq: KeySym = KeySym(0x0ebb); +pub const SYM_Hangul_Tieut: KeySym = KeySym(0x0ebc); +pub const SYM_Hangul_Phieuf: KeySym = KeySym(0x0ebd); +pub const SYM_Hangul_Hieuh: KeySym = KeySym(0x0ebe); +pub const SYM_Hangul_A: KeySym = KeySym(0x0ebf); +pub const SYM_Hangul_AE: KeySym = KeySym(0x0ec0); +pub const SYM_Hangul_YA: KeySym = KeySym(0x0ec1); +pub const SYM_Hangul_YAE: KeySym = KeySym(0x0ec2); +pub const SYM_Hangul_EO: KeySym = KeySym(0x0ec3); +pub const SYM_Hangul_E: KeySym = KeySym(0x0ec4); +pub const SYM_Hangul_YEO: KeySym = KeySym(0x0ec5); +pub const SYM_Hangul_YE: KeySym = KeySym(0x0ec6); +pub const SYM_Hangul_O: KeySym = KeySym(0x0ec7); +pub const SYM_Hangul_WA: KeySym = KeySym(0x0ec8); +pub const SYM_Hangul_WAE: KeySym = KeySym(0x0ec9); +pub const SYM_Hangul_OE: KeySym = KeySym(0x0eca); +pub const SYM_Hangul_YO: KeySym = KeySym(0x0ecb); +pub const SYM_Hangul_U: KeySym = KeySym(0x0ecc); +pub const SYM_Hangul_WEO: KeySym = KeySym(0x0ecd); +pub const SYM_Hangul_WE: KeySym = KeySym(0x0ece); +pub const SYM_Hangul_WI: KeySym = KeySym(0x0ecf); +pub const SYM_Hangul_YU: KeySym = KeySym(0x0ed0); +pub const SYM_Hangul_EU: KeySym = KeySym(0x0ed1); +pub const SYM_Hangul_YI: KeySym = KeySym(0x0ed2); +pub const SYM_Hangul_I: KeySym = KeySym(0x0ed3); +pub const SYM_Hangul_J_Kiyeog: KeySym = KeySym(0x0ed4); +pub const SYM_Hangul_J_SsangKiyeog: KeySym = KeySym(0x0ed5); +pub const SYM_Hangul_J_KiyeogSios: KeySym = KeySym(0x0ed6); +pub const SYM_Hangul_J_Nieun: KeySym = KeySym(0x0ed7); +pub const SYM_Hangul_J_NieunJieuj: KeySym = KeySym(0x0ed8); +pub const SYM_Hangul_J_NieunHieuh: KeySym = KeySym(0x0ed9); +pub const SYM_Hangul_J_Dikeud: KeySym = KeySym(0x0eda); +pub const SYM_Hangul_J_Rieul: KeySym = KeySym(0x0edb); +pub const SYM_Hangul_J_RieulKiyeog: KeySym = KeySym(0x0edc); +pub const SYM_Hangul_J_RieulMieum: KeySym = KeySym(0x0edd); +pub const SYM_Hangul_J_RieulPieub: KeySym = KeySym(0x0ede); +pub const SYM_Hangul_J_RieulSios: KeySym = KeySym(0x0edf); +pub const SYM_Hangul_J_RieulTieut: KeySym = KeySym(0x0ee0); +pub const SYM_Hangul_J_RieulPhieuf: KeySym = KeySym(0x0ee1); +pub const SYM_Hangul_J_RieulHieuh: KeySym = KeySym(0x0ee2); +pub const SYM_Hangul_J_Mieum: KeySym = KeySym(0x0ee3); +pub const SYM_Hangul_J_Pieub: KeySym = KeySym(0x0ee4); +pub const SYM_Hangul_J_PieubSios: KeySym = KeySym(0x0ee5); +pub const SYM_Hangul_J_Sios: KeySym = KeySym(0x0ee6); +pub const SYM_Hangul_J_SsangSios: KeySym = KeySym(0x0ee7); +pub const SYM_Hangul_J_Ieung: KeySym = KeySym(0x0ee8); +pub const SYM_Hangul_J_Jieuj: KeySym = KeySym(0x0ee9); +pub const SYM_Hangul_J_Cieuc: KeySym = KeySym(0x0eea); +pub const SYM_Hangul_J_Khieuq: KeySym = KeySym(0x0eeb); +pub const SYM_Hangul_J_Tieut: KeySym = KeySym(0x0eec); +pub const SYM_Hangul_J_Phieuf: KeySym = KeySym(0x0eed); +pub const SYM_Hangul_J_Hieuh: KeySym = KeySym(0x0eee); +pub const SYM_Hangul_RieulYeorinHieuh: KeySym = KeySym(0x0eef); +pub const SYM_Hangul_SunkyeongeumMieum: KeySym = KeySym(0x0ef0); +pub const SYM_Hangul_SunkyeongeumPieub: KeySym = KeySym(0x0ef1); +pub const SYM_Hangul_PanSios: KeySym = KeySym(0x0ef2); +pub const SYM_Hangul_KkogjiDalrinIeung: KeySym = KeySym(0x0ef3); +pub const SYM_Hangul_SunkyeongeumPhieuf: KeySym = KeySym(0x0ef4); +pub const SYM_Hangul_YeorinHieuh: KeySym = KeySym(0x0ef5); +pub const SYM_Hangul_AraeA: KeySym = KeySym(0x0ef6); +pub const SYM_Hangul_AraeAE: KeySym = KeySym(0x0ef7); +pub const SYM_Hangul_J_PanSios: KeySym = KeySym(0x0ef8); +pub const SYM_Hangul_J_KkogjiDalrinIeung: KeySym = KeySym(0x0ef9); +pub const SYM_Hangul_J_YeorinHieuh: KeySym = KeySym(0x0efa); +pub const SYM_Korean_Won: KeySym = KeySym(0x0eff); +pub const SYM_Armenian_ligature_ew: KeySym = KeySym(0x1000587); +pub const SYM_Armenian_full_stop: KeySym = KeySym(0x1000589); +pub const SYM_Armenian_verjaket: KeySym = KeySym(0x1000589); +pub const SYM_Armenian_separation_mark: KeySym = KeySym(0x100055d); +pub const SYM_Armenian_but: KeySym = KeySym(0x100055d); +pub const SYM_Armenian_hyphen: KeySym = KeySym(0x100058a); +pub const SYM_Armenian_yentamna: KeySym = KeySym(0x100058a); +pub const SYM_Armenian_exclam: KeySym = KeySym(0x100055c); +pub const SYM_Armenian_amanak: KeySym = KeySym(0x100055c); +pub const SYM_Armenian_accent: KeySym = KeySym(0x100055b); +pub const SYM_Armenian_shesht: KeySym = KeySym(0x100055b); +pub const SYM_Armenian_question: KeySym = KeySym(0x100055e); +pub const SYM_Armenian_paruyk: KeySym = KeySym(0x100055e); +pub const SYM_Armenian_AYB: KeySym = KeySym(0x1000531); +pub const SYM_Armenian_ayb: KeySym = KeySym(0x1000561); +pub const SYM_Armenian_BEN: KeySym = KeySym(0x1000532); +pub const SYM_Armenian_ben: KeySym = KeySym(0x1000562); +pub const SYM_Armenian_GIM: KeySym = KeySym(0x1000533); +pub const SYM_Armenian_gim: KeySym = KeySym(0x1000563); +pub const SYM_Armenian_DA: KeySym = KeySym(0x1000534); +pub const SYM_Armenian_da: KeySym = KeySym(0x1000564); +pub const SYM_Armenian_YECH: KeySym = KeySym(0x1000535); +pub const SYM_Armenian_yech: KeySym = KeySym(0x1000565); +pub const SYM_Armenian_ZA: KeySym = KeySym(0x1000536); +pub const SYM_Armenian_za: KeySym = KeySym(0x1000566); +pub const SYM_Armenian_E: KeySym = KeySym(0x1000537); +pub const SYM_Armenian_e: KeySym = KeySym(0x1000567); +pub const SYM_Armenian_AT: KeySym = KeySym(0x1000538); +pub const SYM_Armenian_at: KeySym = KeySym(0x1000568); +pub const SYM_Armenian_TO: KeySym = KeySym(0x1000539); +pub const SYM_Armenian_to: KeySym = KeySym(0x1000569); +pub const SYM_Armenian_ZHE: KeySym = KeySym(0x100053a); +pub const SYM_Armenian_zhe: KeySym = KeySym(0x100056a); +pub const SYM_Armenian_INI: KeySym = KeySym(0x100053b); +pub const SYM_Armenian_ini: KeySym = KeySym(0x100056b); +pub const SYM_Armenian_LYUN: KeySym = KeySym(0x100053c); +pub const SYM_Armenian_lyun: KeySym = KeySym(0x100056c); +pub const SYM_Armenian_KHE: KeySym = KeySym(0x100053d); +pub const SYM_Armenian_khe: KeySym = KeySym(0x100056d); +pub const SYM_Armenian_TSA: KeySym = KeySym(0x100053e); +pub const SYM_Armenian_tsa: KeySym = KeySym(0x100056e); +pub const SYM_Armenian_KEN: KeySym = KeySym(0x100053f); +pub const SYM_Armenian_ken: KeySym = KeySym(0x100056f); +pub const SYM_Armenian_HO: KeySym = KeySym(0x1000540); +pub const SYM_Armenian_ho: KeySym = KeySym(0x1000570); +pub const SYM_Armenian_DZA: KeySym = KeySym(0x1000541); +pub const SYM_Armenian_dza: KeySym = KeySym(0x1000571); +pub const SYM_Armenian_GHAT: KeySym = KeySym(0x1000542); +pub const SYM_Armenian_ghat: KeySym = KeySym(0x1000572); +pub const SYM_Armenian_TCHE: KeySym = KeySym(0x1000543); +pub const SYM_Armenian_tche: KeySym = KeySym(0x1000573); +pub const SYM_Armenian_MEN: KeySym = KeySym(0x1000544); +pub const SYM_Armenian_men: KeySym = KeySym(0x1000574); +pub const SYM_Armenian_HI: KeySym = KeySym(0x1000545); +pub const SYM_Armenian_hi: KeySym = KeySym(0x1000575); +pub const SYM_Armenian_NU: KeySym = KeySym(0x1000546); +pub const SYM_Armenian_nu: KeySym = KeySym(0x1000576); +pub const SYM_Armenian_SHA: KeySym = KeySym(0x1000547); +pub const SYM_Armenian_sha: KeySym = KeySym(0x1000577); +pub const SYM_Armenian_VO: KeySym = KeySym(0x1000548); +pub const SYM_Armenian_vo: KeySym = KeySym(0x1000578); +pub const SYM_Armenian_CHA: KeySym = KeySym(0x1000549); +pub const SYM_Armenian_cha: KeySym = KeySym(0x1000579); +pub const SYM_Armenian_PE: KeySym = KeySym(0x100054a); +pub const SYM_Armenian_pe: KeySym = KeySym(0x100057a); +pub const SYM_Armenian_JE: KeySym = KeySym(0x100054b); +pub const SYM_Armenian_je: KeySym = KeySym(0x100057b); +pub const SYM_Armenian_RA: KeySym = KeySym(0x100054c); +pub const SYM_Armenian_ra: KeySym = KeySym(0x100057c); +pub const SYM_Armenian_SE: KeySym = KeySym(0x100054d); +pub const SYM_Armenian_se: KeySym = KeySym(0x100057d); +pub const SYM_Armenian_VEV: KeySym = KeySym(0x100054e); +pub const SYM_Armenian_vev: KeySym = KeySym(0x100057e); +pub const SYM_Armenian_TYUN: KeySym = KeySym(0x100054f); +pub const SYM_Armenian_tyun: KeySym = KeySym(0x100057f); +pub const SYM_Armenian_RE: KeySym = KeySym(0x1000550); +pub const SYM_Armenian_re: KeySym = KeySym(0x1000580); +pub const SYM_Armenian_TSO: KeySym = KeySym(0x1000551); +pub const SYM_Armenian_tso: KeySym = KeySym(0x1000581); +pub const SYM_Armenian_VYUN: KeySym = KeySym(0x1000552); +pub const SYM_Armenian_vyun: KeySym = KeySym(0x1000582); +pub const SYM_Armenian_PYUR: KeySym = KeySym(0x1000553); +pub const SYM_Armenian_pyur: KeySym = KeySym(0x1000583); +pub const SYM_Armenian_KE: KeySym = KeySym(0x1000554); +pub const SYM_Armenian_ke: KeySym = KeySym(0x1000584); +pub const SYM_Armenian_O: KeySym = KeySym(0x1000555); +pub const SYM_Armenian_o: KeySym = KeySym(0x1000585); +pub const SYM_Armenian_FE: KeySym = KeySym(0x1000556); +pub const SYM_Armenian_fe: KeySym = KeySym(0x1000586); +pub const SYM_Armenian_apostrophe: KeySym = KeySym(0x100055a); +pub const SYM_Georgian_an: KeySym = KeySym(0x10010d0); +pub const SYM_Georgian_ban: KeySym = KeySym(0x10010d1); +pub const SYM_Georgian_gan: KeySym = KeySym(0x10010d2); +pub const SYM_Georgian_don: KeySym = KeySym(0x10010d3); +pub const SYM_Georgian_en: KeySym = KeySym(0x10010d4); +pub const SYM_Georgian_vin: KeySym = KeySym(0x10010d5); +pub const SYM_Georgian_zen: KeySym = KeySym(0x10010d6); +pub const SYM_Georgian_tan: KeySym = KeySym(0x10010d7); +pub const SYM_Georgian_in: KeySym = KeySym(0x10010d8); +pub const SYM_Georgian_kan: KeySym = KeySym(0x10010d9); +pub const SYM_Georgian_las: KeySym = KeySym(0x10010da); +pub const SYM_Georgian_man: KeySym = KeySym(0x10010db); +pub const SYM_Georgian_nar: KeySym = KeySym(0x10010dc); +pub const SYM_Georgian_on: KeySym = KeySym(0x10010dd); +pub const SYM_Georgian_par: KeySym = KeySym(0x10010de); +pub const SYM_Georgian_zhar: KeySym = KeySym(0x10010df); +pub const SYM_Georgian_rae: KeySym = KeySym(0x10010e0); +pub const SYM_Georgian_san: KeySym = KeySym(0x10010e1); +pub const SYM_Georgian_tar: KeySym = KeySym(0x10010e2); +pub const SYM_Georgian_un: KeySym = KeySym(0x10010e3); +pub const SYM_Georgian_phar: KeySym = KeySym(0x10010e4); +pub const SYM_Georgian_khar: KeySym = KeySym(0x10010e5); +pub const SYM_Georgian_ghan: KeySym = KeySym(0x10010e6); +pub const SYM_Georgian_qar: KeySym = KeySym(0x10010e7); +pub const SYM_Georgian_shin: KeySym = KeySym(0x10010e8); +pub const SYM_Georgian_chin: KeySym = KeySym(0x10010e9); +pub const SYM_Georgian_can: KeySym = KeySym(0x10010ea); +pub const SYM_Georgian_jil: KeySym = KeySym(0x10010eb); +pub const SYM_Georgian_cil: KeySym = KeySym(0x10010ec); +pub const SYM_Georgian_char: KeySym = KeySym(0x10010ed); +pub const SYM_Georgian_xan: KeySym = KeySym(0x10010ee); +pub const SYM_Georgian_jhan: KeySym = KeySym(0x10010ef); +pub const SYM_Georgian_hae: KeySym = KeySym(0x10010f0); +pub const SYM_Georgian_he: KeySym = KeySym(0x10010f1); +pub const SYM_Georgian_hie: KeySym = KeySym(0x10010f2); +pub const SYM_Georgian_we: KeySym = KeySym(0x10010f3); +pub const SYM_Georgian_har: KeySym = KeySym(0x10010f4); +pub const SYM_Georgian_hoe: KeySym = KeySym(0x10010f5); +pub const SYM_Georgian_fi: KeySym = KeySym(0x10010f6); +pub const SYM_Xabovedot: KeySym = KeySym(0x1001e8a); +pub const SYM_Ibreve: KeySym = KeySym(0x100012c); +pub const SYM_Zstroke: KeySym = KeySym(0x10001b5); +pub const SYM_Gcaron: KeySym = KeySym(0x10001e6); +pub const SYM_Ocaron: KeySym = KeySym(0x10001d1); +pub const SYM_Obarred: KeySym = KeySym(0x100019f); +pub const SYM_xabovedot: KeySym = KeySym(0x1001e8b); +pub const SYM_ibreve: KeySym = KeySym(0x100012d); +pub const SYM_zstroke: KeySym = KeySym(0x10001b6); +pub const SYM_gcaron: KeySym = KeySym(0x10001e7); +pub const SYM_ocaron: KeySym = KeySym(0x10001d2); +pub const SYM_obarred: KeySym = KeySym(0x1000275); +pub const SYM_SCHWA: KeySym = KeySym(0x100018f); +pub const SYM_schwa: KeySym = KeySym(0x1000259); +pub const SYM_EZH: KeySym = KeySym(0x10001b7); +pub const SYM_ezh: KeySym = KeySym(0x1000292); +pub const SYM_Lbelowdot: KeySym = KeySym(0x1001e36); +pub const SYM_lbelowdot: KeySym = KeySym(0x1001e37); +pub const SYM_Abelowdot: KeySym = KeySym(0x1001ea0); +pub const SYM_abelowdot: KeySym = KeySym(0x1001ea1); +pub const SYM_Ahook: KeySym = KeySym(0x1001ea2); +pub const SYM_ahook: KeySym = KeySym(0x1001ea3); +pub const SYM_Acircumflexacute: KeySym = KeySym(0x1001ea4); +pub const SYM_acircumflexacute: KeySym = KeySym(0x1001ea5); +pub const SYM_Acircumflexgrave: KeySym = KeySym(0x1001ea6); +pub const SYM_acircumflexgrave: KeySym = KeySym(0x1001ea7); +pub const SYM_Acircumflexhook: KeySym = KeySym(0x1001ea8); +pub const SYM_acircumflexhook: KeySym = KeySym(0x1001ea9); +pub const SYM_Acircumflextilde: KeySym = KeySym(0x1001eaa); +pub const SYM_acircumflextilde: KeySym = KeySym(0x1001eab); +pub const SYM_Acircumflexbelowdot: KeySym = KeySym(0x1001eac); +pub const SYM_acircumflexbelowdot: KeySym = KeySym(0x1001ead); +pub const SYM_Abreveacute: KeySym = KeySym(0x1001eae); +pub const SYM_abreveacute: KeySym = KeySym(0x1001eaf); +pub const SYM_Abrevegrave: KeySym = KeySym(0x1001eb0); +pub const SYM_abrevegrave: KeySym = KeySym(0x1001eb1); +pub const SYM_Abrevehook: KeySym = KeySym(0x1001eb2); +pub const SYM_abrevehook: KeySym = KeySym(0x1001eb3); +pub const SYM_Abrevetilde: KeySym = KeySym(0x1001eb4); +pub const SYM_abrevetilde: KeySym = KeySym(0x1001eb5); +pub const SYM_Abrevebelowdot: KeySym = KeySym(0x1001eb6); +pub const SYM_abrevebelowdot: KeySym = KeySym(0x1001eb7); +pub const SYM_Ebelowdot: KeySym = KeySym(0x1001eb8); +pub const SYM_ebelowdot: KeySym = KeySym(0x1001eb9); +pub const SYM_Ehook: KeySym = KeySym(0x1001eba); +pub const SYM_ehook: KeySym = KeySym(0x1001ebb); +pub const SYM_Etilde: KeySym = KeySym(0x1001ebc); +pub const SYM_etilde: KeySym = KeySym(0x1001ebd); +pub const SYM_Ecircumflexacute: KeySym = KeySym(0x1001ebe); +pub const SYM_ecircumflexacute: KeySym = KeySym(0x1001ebf); +pub const SYM_Ecircumflexgrave: KeySym = KeySym(0x1001ec0); +pub const SYM_ecircumflexgrave: KeySym = KeySym(0x1001ec1); +pub const SYM_Ecircumflexhook: KeySym = KeySym(0x1001ec2); +pub const SYM_ecircumflexhook: KeySym = KeySym(0x1001ec3); +pub const SYM_Ecircumflextilde: KeySym = KeySym(0x1001ec4); +pub const SYM_ecircumflextilde: KeySym = KeySym(0x1001ec5); +pub const SYM_Ecircumflexbelowdot: KeySym = KeySym(0x1001ec6); +pub const SYM_ecircumflexbelowdot: KeySym = KeySym(0x1001ec7); +pub const SYM_Ihook: KeySym = KeySym(0x1001ec8); +pub const SYM_ihook: KeySym = KeySym(0x1001ec9); +pub const SYM_Ibelowdot: KeySym = KeySym(0x1001eca); +pub const SYM_ibelowdot: KeySym = KeySym(0x1001ecb); +pub const SYM_Obelowdot: KeySym = KeySym(0x1001ecc); +pub const SYM_obelowdot: KeySym = KeySym(0x1001ecd); +pub const SYM_Ohook: KeySym = KeySym(0x1001ece); +pub const SYM_ohook: KeySym = KeySym(0x1001ecf); +pub const SYM_Ocircumflexacute: KeySym = KeySym(0x1001ed0); +pub const SYM_ocircumflexacute: KeySym = KeySym(0x1001ed1); +pub const SYM_Ocircumflexgrave: KeySym = KeySym(0x1001ed2); +pub const SYM_ocircumflexgrave: KeySym = KeySym(0x1001ed3); +pub const SYM_Ocircumflexhook: KeySym = KeySym(0x1001ed4); +pub const SYM_ocircumflexhook: KeySym = KeySym(0x1001ed5); +pub const SYM_Ocircumflextilde: KeySym = KeySym(0x1001ed6); +pub const SYM_ocircumflextilde: KeySym = KeySym(0x1001ed7); +pub const SYM_Ocircumflexbelowdot: KeySym = KeySym(0x1001ed8); +pub const SYM_ocircumflexbelowdot: KeySym = KeySym(0x1001ed9); +pub const SYM_Ohornacute: KeySym = KeySym(0x1001eda); +pub const SYM_ohornacute: KeySym = KeySym(0x1001edb); +pub const SYM_Ohorngrave: KeySym = KeySym(0x1001edc); +pub const SYM_ohorngrave: KeySym = KeySym(0x1001edd); +pub const SYM_Ohornhook: KeySym = KeySym(0x1001ede); +pub const SYM_ohornhook: KeySym = KeySym(0x1001edf); +pub const SYM_Ohorntilde: KeySym = KeySym(0x1001ee0); +pub const SYM_ohorntilde: KeySym = KeySym(0x1001ee1); +pub const SYM_Ohornbelowdot: KeySym = KeySym(0x1001ee2); +pub const SYM_ohornbelowdot: KeySym = KeySym(0x1001ee3); +pub const SYM_Ubelowdot: KeySym = KeySym(0x1001ee4); +pub const SYM_ubelowdot: KeySym = KeySym(0x1001ee5); +pub const SYM_Uhook: KeySym = KeySym(0x1001ee6); +pub const SYM_uhook: KeySym = KeySym(0x1001ee7); +pub const SYM_Uhornacute: KeySym = KeySym(0x1001ee8); +pub const SYM_uhornacute: KeySym = KeySym(0x1001ee9); +pub const SYM_Uhorngrave: KeySym = KeySym(0x1001eea); +pub const SYM_uhorngrave: KeySym = KeySym(0x1001eeb); +pub const SYM_Uhornhook: KeySym = KeySym(0x1001eec); +pub const SYM_uhornhook: KeySym = KeySym(0x1001eed); +pub const SYM_Uhorntilde: KeySym = KeySym(0x1001eee); +pub const SYM_uhorntilde: KeySym = KeySym(0x1001eef); +pub const SYM_Uhornbelowdot: KeySym = KeySym(0x1001ef0); +pub const SYM_uhornbelowdot: KeySym = KeySym(0x1001ef1); +pub const SYM_Ybelowdot: KeySym = KeySym(0x1001ef4); +pub const SYM_ybelowdot: KeySym = KeySym(0x1001ef5); +pub const SYM_Yhook: KeySym = KeySym(0x1001ef6); +pub const SYM_yhook: KeySym = KeySym(0x1001ef7); +pub const SYM_Ytilde: KeySym = KeySym(0x1001ef8); +pub const SYM_ytilde: KeySym = KeySym(0x1001ef9); +pub const SYM_Ohorn: KeySym = KeySym(0x10001a0); +pub const SYM_ohorn: KeySym = KeySym(0x10001a1); +pub const SYM_Uhorn: KeySym = KeySym(0x10001af); +pub const SYM_uhorn: KeySym = KeySym(0x10001b0); +pub const SYM_combining_tilde: KeySym = KeySym(0x1000303); +pub const SYM_combining_grave: KeySym = KeySym(0x1000300); +pub const SYM_combining_acute: KeySym = KeySym(0x1000301); +pub const SYM_combining_hook: KeySym = KeySym(0x1000309); +pub const SYM_combining_belowdot: KeySym = KeySym(0x1000323); +pub const SYM_EcuSign: KeySym = KeySym(0x10020a0); +pub const SYM_ColonSign: KeySym = KeySym(0x10020a1); +pub const SYM_CruzeiroSign: KeySym = KeySym(0x10020a2); +pub const SYM_FFrancSign: KeySym = KeySym(0x10020a3); +pub const SYM_LiraSign: KeySym = KeySym(0x10020a4); +pub const SYM_MillSign: KeySym = KeySym(0x10020a5); +pub const SYM_NairaSign: KeySym = KeySym(0x10020a6); +pub const SYM_PesetaSign: KeySym = KeySym(0x10020a7); +pub const SYM_RupeeSign: KeySym = KeySym(0x10020a8); +pub const SYM_WonSign: KeySym = KeySym(0x10020a9); +pub const SYM_NewSheqelSign: KeySym = KeySym(0x10020aa); +pub const SYM_DongSign: KeySym = KeySym(0x10020ab); +pub const SYM_EuroSign: KeySym = KeySym(0x20ac); +pub const SYM_zerosuperior: KeySym = KeySym(0x1002070); +pub const SYM_foursuperior: KeySym = KeySym(0x1002074); +pub const SYM_fivesuperior: KeySym = KeySym(0x1002075); +pub const SYM_sixsuperior: KeySym = KeySym(0x1002076); +pub const SYM_sevensuperior: KeySym = KeySym(0x1002077); +pub const SYM_eightsuperior: KeySym = KeySym(0x1002078); +pub const SYM_ninesuperior: KeySym = KeySym(0x1002079); +pub const SYM_zerosubscript: KeySym = KeySym(0x1002080); +pub const SYM_onesubscript: KeySym = KeySym(0x1002081); +pub const SYM_twosubscript: KeySym = KeySym(0x1002082); +pub const SYM_threesubscript: KeySym = KeySym(0x1002083); +pub const SYM_foursubscript: KeySym = KeySym(0x1002084); +pub const SYM_fivesubscript: KeySym = KeySym(0x1002085); +pub const SYM_sixsubscript: KeySym = KeySym(0x1002086); +pub const SYM_sevensubscript: KeySym = KeySym(0x1002087); +pub const SYM_eightsubscript: KeySym = KeySym(0x1002088); +pub const SYM_ninesubscript: KeySym = KeySym(0x1002089); +pub const SYM_partdifferential: KeySym = KeySym(0x1002202); +pub const SYM_emptyset: KeySym = KeySym(0x1002205); +pub const SYM_elementof: KeySym = KeySym(0x1002208); +pub const SYM_notelementof: KeySym = KeySym(0x1002209); +pub const SYM_containsas: KeySym = KeySym(0x100220B); +pub const SYM_squareroot: KeySym = KeySym(0x100221A); +pub const SYM_cuberoot: KeySym = KeySym(0x100221B); +pub const SYM_fourthroot: KeySym = KeySym(0x100221C); +pub const SYM_dintegral: KeySym = KeySym(0x100222C); +pub const SYM_tintegral: KeySym = KeySym(0x100222D); +pub const SYM_because: KeySym = KeySym(0x1002235); +pub const SYM_approxeq: KeySym = KeySym(0x1002248); +pub const SYM_notapproxeq: KeySym = KeySym(0x1002247); +pub const SYM_notidentical: KeySym = KeySym(0x1002262); +pub const SYM_stricteq: KeySym = KeySym(0x1002263); +pub const SYM_braille_dot_1: KeySym = KeySym(0xfff1); +pub const SYM_braille_dot_2: KeySym = KeySym(0xfff2); +pub const SYM_braille_dot_3: KeySym = KeySym(0xfff3); +pub const SYM_braille_dot_4: KeySym = KeySym(0xfff4); +pub const SYM_braille_dot_5: KeySym = KeySym(0xfff5); +pub const SYM_braille_dot_6: KeySym = KeySym(0xfff6); +pub const SYM_braille_dot_7: KeySym = KeySym(0xfff7); +pub const SYM_braille_dot_8: KeySym = KeySym(0xfff8); +pub const SYM_braille_dot_9: KeySym = KeySym(0xfff9); +pub const SYM_braille_dot_10: KeySym = KeySym(0xfffa); +pub const SYM_braille_blank: KeySym = KeySym(0x1002800); +pub const SYM_braille_dots_1: KeySym = KeySym(0x1002801); +pub const SYM_braille_dots_2: KeySym = KeySym(0x1002802); +pub const SYM_braille_dots_12: KeySym = KeySym(0x1002803); +pub const SYM_braille_dots_3: KeySym = KeySym(0x1002804); +pub const SYM_braille_dots_13: KeySym = KeySym(0x1002805); +pub const SYM_braille_dots_23: KeySym = KeySym(0x1002806); +pub const SYM_braille_dots_123: KeySym = KeySym(0x1002807); +pub const SYM_braille_dots_4: KeySym = KeySym(0x1002808); +pub const SYM_braille_dots_14: KeySym = KeySym(0x1002809); +pub const SYM_braille_dots_24: KeySym = KeySym(0x100280a); +pub const SYM_braille_dots_124: KeySym = KeySym(0x100280b); +pub const SYM_braille_dots_34: KeySym = KeySym(0x100280c); +pub const SYM_braille_dots_134: KeySym = KeySym(0x100280d); +pub const SYM_braille_dots_234: KeySym = KeySym(0x100280e); +pub const SYM_braille_dots_1234: KeySym = KeySym(0x100280f); +pub const SYM_braille_dots_5: KeySym = KeySym(0x1002810); +pub const SYM_braille_dots_15: KeySym = KeySym(0x1002811); +pub const SYM_braille_dots_25: KeySym = KeySym(0x1002812); +pub const SYM_braille_dots_125: KeySym = KeySym(0x1002813); +pub const SYM_braille_dots_35: KeySym = KeySym(0x1002814); +pub const SYM_braille_dots_135: KeySym = KeySym(0x1002815); +pub const SYM_braille_dots_235: KeySym = KeySym(0x1002816); +pub const SYM_braille_dots_1235: KeySym = KeySym(0x1002817); +pub const SYM_braille_dots_45: KeySym = KeySym(0x1002818); +pub const SYM_braille_dots_145: KeySym = KeySym(0x1002819); +pub const SYM_braille_dots_245: KeySym = KeySym(0x100281a); +pub const SYM_braille_dots_1245: KeySym = KeySym(0x100281b); +pub const SYM_braille_dots_345: KeySym = KeySym(0x100281c); +pub const SYM_braille_dots_1345: KeySym = KeySym(0x100281d); +pub const SYM_braille_dots_2345: KeySym = KeySym(0x100281e); +pub const SYM_braille_dots_12345: KeySym = KeySym(0x100281f); +pub const SYM_braille_dots_6: KeySym = KeySym(0x1002820); +pub const SYM_braille_dots_16: KeySym = KeySym(0x1002821); +pub const SYM_braille_dots_26: KeySym = KeySym(0x1002822); +pub const SYM_braille_dots_126: KeySym = KeySym(0x1002823); +pub const SYM_braille_dots_36: KeySym = KeySym(0x1002824); +pub const SYM_braille_dots_136: KeySym = KeySym(0x1002825); +pub const SYM_braille_dots_236: KeySym = KeySym(0x1002826); +pub const SYM_braille_dots_1236: KeySym = KeySym(0x1002827); +pub const SYM_braille_dots_46: KeySym = KeySym(0x1002828); +pub const SYM_braille_dots_146: KeySym = KeySym(0x1002829); +pub const SYM_braille_dots_246: KeySym = KeySym(0x100282a); +pub const SYM_braille_dots_1246: KeySym = KeySym(0x100282b); +pub const SYM_braille_dots_346: KeySym = KeySym(0x100282c); +pub const SYM_braille_dots_1346: KeySym = KeySym(0x100282d); +pub const SYM_braille_dots_2346: KeySym = KeySym(0x100282e); +pub const SYM_braille_dots_12346: KeySym = KeySym(0x100282f); +pub const SYM_braille_dots_56: KeySym = KeySym(0x1002830); +pub const SYM_braille_dots_156: KeySym = KeySym(0x1002831); +pub const SYM_braille_dots_256: KeySym = KeySym(0x1002832); +pub const SYM_braille_dots_1256: KeySym = KeySym(0x1002833); +pub const SYM_braille_dots_356: KeySym = KeySym(0x1002834); +pub const SYM_braille_dots_1356: KeySym = KeySym(0x1002835); +pub const SYM_braille_dots_2356: KeySym = KeySym(0x1002836); +pub const SYM_braille_dots_12356: KeySym = KeySym(0x1002837); +pub const SYM_braille_dots_456: KeySym = KeySym(0x1002838); +pub const SYM_braille_dots_1456: KeySym = KeySym(0x1002839); +pub const SYM_braille_dots_2456: KeySym = KeySym(0x100283a); +pub const SYM_braille_dots_12456: KeySym = KeySym(0x100283b); +pub const SYM_braille_dots_3456: KeySym = KeySym(0x100283c); +pub const SYM_braille_dots_13456: KeySym = KeySym(0x100283d); +pub const SYM_braille_dots_23456: KeySym = KeySym(0x100283e); +pub const SYM_braille_dots_123456: KeySym = KeySym(0x100283f); +pub const SYM_braille_dots_7: KeySym = KeySym(0x1002840); +pub const SYM_braille_dots_17: KeySym = KeySym(0x1002841); +pub const SYM_braille_dots_27: KeySym = KeySym(0x1002842); +pub const SYM_braille_dots_127: KeySym = KeySym(0x1002843); +pub const SYM_braille_dots_37: KeySym = KeySym(0x1002844); +pub const SYM_braille_dots_137: KeySym = KeySym(0x1002845); +pub const SYM_braille_dots_237: KeySym = KeySym(0x1002846); +pub const SYM_braille_dots_1237: KeySym = KeySym(0x1002847); +pub const SYM_braille_dots_47: KeySym = KeySym(0x1002848); +pub const SYM_braille_dots_147: KeySym = KeySym(0x1002849); +pub const SYM_braille_dots_247: KeySym = KeySym(0x100284a); +pub const SYM_braille_dots_1247: KeySym = KeySym(0x100284b); +pub const SYM_braille_dots_347: KeySym = KeySym(0x100284c); +pub const SYM_braille_dots_1347: KeySym = KeySym(0x100284d); +pub const SYM_braille_dots_2347: KeySym = KeySym(0x100284e); +pub const SYM_braille_dots_12347: KeySym = KeySym(0x100284f); +pub const SYM_braille_dots_57: KeySym = KeySym(0x1002850); +pub const SYM_braille_dots_157: KeySym = KeySym(0x1002851); +pub const SYM_braille_dots_257: KeySym = KeySym(0x1002852); +pub const SYM_braille_dots_1257: KeySym = KeySym(0x1002853); +pub const SYM_braille_dots_357: KeySym = KeySym(0x1002854); +pub const SYM_braille_dots_1357: KeySym = KeySym(0x1002855); +pub const SYM_braille_dots_2357: KeySym = KeySym(0x1002856); +pub const SYM_braille_dots_12357: KeySym = KeySym(0x1002857); +pub const SYM_braille_dots_457: KeySym = KeySym(0x1002858); +pub const SYM_braille_dots_1457: KeySym = KeySym(0x1002859); +pub const SYM_braille_dots_2457: KeySym = KeySym(0x100285a); +pub const SYM_braille_dots_12457: KeySym = KeySym(0x100285b); +pub const SYM_braille_dots_3457: KeySym = KeySym(0x100285c); +pub const SYM_braille_dots_13457: KeySym = KeySym(0x100285d); +pub const SYM_braille_dots_23457: KeySym = KeySym(0x100285e); +pub const SYM_braille_dots_123457: KeySym = KeySym(0x100285f); +pub const SYM_braille_dots_67: KeySym = KeySym(0x1002860); +pub const SYM_braille_dots_167: KeySym = KeySym(0x1002861); +pub const SYM_braille_dots_267: KeySym = KeySym(0x1002862); +pub const SYM_braille_dots_1267: KeySym = KeySym(0x1002863); +pub const SYM_braille_dots_367: KeySym = KeySym(0x1002864); +pub const SYM_braille_dots_1367: KeySym = KeySym(0x1002865); +pub const SYM_braille_dots_2367: KeySym = KeySym(0x1002866); +pub const SYM_braille_dots_12367: KeySym = KeySym(0x1002867); +pub const SYM_braille_dots_467: KeySym = KeySym(0x1002868); +pub const SYM_braille_dots_1467: KeySym = KeySym(0x1002869); +pub const SYM_braille_dots_2467: KeySym = KeySym(0x100286a); +pub const SYM_braille_dots_12467: KeySym = KeySym(0x100286b); +pub const SYM_braille_dots_3467: KeySym = KeySym(0x100286c); +pub const SYM_braille_dots_13467: KeySym = KeySym(0x100286d); +pub const SYM_braille_dots_23467: KeySym = KeySym(0x100286e); +pub const SYM_braille_dots_123467: KeySym = KeySym(0x100286f); +pub const SYM_braille_dots_567: KeySym = KeySym(0x1002870); +pub const SYM_braille_dots_1567: KeySym = KeySym(0x1002871); +pub const SYM_braille_dots_2567: KeySym = KeySym(0x1002872); +pub const SYM_braille_dots_12567: KeySym = KeySym(0x1002873); +pub const SYM_braille_dots_3567: KeySym = KeySym(0x1002874); +pub const SYM_braille_dots_13567: KeySym = KeySym(0x1002875); +pub const SYM_braille_dots_23567: KeySym = KeySym(0x1002876); +pub const SYM_braille_dots_123567: KeySym = KeySym(0x1002877); +pub const SYM_braille_dots_4567: KeySym = KeySym(0x1002878); +pub const SYM_braille_dots_14567: KeySym = KeySym(0x1002879); +pub const SYM_braille_dots_24567: KeySym = KeySym(0x100287a); +pub const SYM_braille_dots_124567: KeySym = KeySym(0x100287b); +pub const SYM_braille_dots_34567: KeySym = KeySym(0x100287c); +pub const SYM_braille_dots_134567: KeySym = KeySym(0x100287d); +pub const SYM_braille_dots_234567: KeySym = KeySym(0x100287e); +pub const SYM_braille_dots_1234567: KeySym = KeySym(0x100287f); +pub const SYM_braille_dots_8: KeySym = KeySym(0x1002880); +pub const SYM_braille_dots_18: KeySym = KeySym(0x1002881); +pub const SYM_braille_dots_28: KeySym = KeySym(0x1002882); +pub const SYM_braille_dots_128: KeySym = KeySym(0x1002883); +pub const SYM_braille_dots_38: KeySym = KeySym(0x1002884); +pub const SYM_braille_dots_138: KeySym = KeySym(0x1002885); +pub const SYM_braille_dots_238: KeySym = KeySym(0x1002886); +pub const SYM_braille_dots_1238: KeySym = KeySym(0x1002887); +pub const SYM_braille_dots_48: KeySym = KeySym(0x1002888); +pub const SYM_braille_dots_148: KeySym = KeySym(0x1002889); +pub const SYM_braille_dots_248: KeySym = KeySym(0x100288a); +pub const SYM_braille_dots_1248: KeySym = KeySym(0x100288b); +pub const SYM_braille_dots_348: KeySym = KeySym(0x100288c); +pub const SYM_braille_dots_1348: KeySym = KeySym(0x100288d); +pub const SYM_braille_dots_2348: KeySym = KeySym(0x100288e); +pub const SYM_braille_dots_12348: KeySym = KeySym(0x100288f); +pub const SYM_braille_dots_58: KeySym = KeySym(0x1002890); +pub const SYM_braille_dots_158: KeySym = KeySym(0x1002891); +pub const SYM_braille_dots_258: KeySym = KeySym(0x1002892); +pub const SYM_braille_dots_1258: KeySym = KeySym(0x1002893); +pub const SYM_braille_dots_358: KeySym = KeySym(0x1002894); +pub const SYM_braille_dots_1358: KeySym = KeySym(0x1002895); +pub const SYM_braille_dots_2358: KeySym = KeySym(0x1002896); +pub const SYM_braille_dots_12358: KeySym = KeySym(0x1002897); +pub const SYM_braille_dots_458: KeySym = KeySym(0x1002898); +pub const SYM_braille_dots_1458: KeySym = KeySym(0x1002899); +pub const SYM_braille_dots_2458: KeySym = KeySym(0x100289a); +pub const SYM_braille_dots_12458: KeySym = KeySym(0x100289b); +pub const SYM_braille_dots_3458: KeySym = KeySym(0x100289c); +pub const SYM_braille_dots_13458: KeySym = KeySym(0x100289d); +pub const SYM_braille_dots_23458: KeySym = KeySym(0x100289e); +pub const SYM_braille_dots_123458: KeySym = KeySym(0x100289f); +pub const SYM_braille_dots_68: KeySym = KeySym(0x10028a0); +pub const SYM_braille_dots_168: KeySym = KeySym(0x10028a1); +pub const SYM_braille_dots_268: KeySym = KeySym(0x10028a2); +pub const SYM_braille_dots_1268: KeySym = KeySym(0x10028a3); +pub const SYM_braille_dots_368: KeySym = KeySym(0x10028a4); +pub const SYM_braille_dots_1368: KeySym = KeySym(0x10028a5); +pub const SYM_braille_dots_2368: KeySym = KeySym(0x10028a6); +pub const SYM_braille_dots_12368: KeySym = KeySym(0x10028a7); +pub const SYM_braille_dots_468: KeySym = KeySym(0x10028a8); +pub const SYM_braille_dots_1468: KeySym = KeySym(0x10028a9); +pub const SYM_braille_dots_2468: KeySym = KeySym(0x10028aa); +pub const SYM_braille_dots_12468: KeySym = KeySym(0x10028ab); +pub const SYM_braille_dots_3468: KeySym = KeySym(0x10028ac); +pub const SYM_braille_dots_13468: KeySym = KeySym(0x10028ad); +pub const SYM_braille_dots_23468: KeySym = KeySym(0x10028ae); +pub const SYM_braille_dots_123468: KeySym = KeySym(0x10028af); +pub const SYM_braille_dots_568: KeySym = KeySym(0x10028b0); +pub const SYM_braille_dots_1568: KeySym = KeySym(0x10028b1); +pub const SYM_braille_dots_2568: KeySym = KeySym(0x10028b2); +pub const SYM_braille_dots_12568: KeySym = KeySym(0x10028b3); +pub const SYM_braille_dots_3568: KeySym = KeySym(0x10028b4); +pub const SYM_braille_dots_13568: KeySym = KeySym(0x10028b5); +pub const SYM_braille_dots_23568: KeySym = KeySym(0x10028b6); +pub const SYM_braille_dots_123568: KeySym = KeySym(0x10028b7); +pub const SYM_braille_dots_4568: KeySym = KeySym(0x10028b8); +pub const SYM_braille_dots_14568: KeySym = KeySym(0x10028b9); +pub const SYM_braille_dots_24568: KeySym = KeySym(0x10028ba); +pub const SYM_braille_dots_124568: KeySym = KeySym(0x10028bb); +pub const SYM_braille_dots_34568: KeySym = KeySym(0x10028bc); +pub const SYM_braille_dots_134568: KeySym = KeySym(0x10028bd); +pub const SYM_braille_dots_234568: KeySym = KeySym(0x10028be); +pub const SYM_braille_dots_1234568: KeySym = KeySym(0x10028bf); +pub const SYM_braille_dots_78: KeySym = KeySym(0x10028c0); +pub const SYM_braille_dots_178: KeySym = KeySym(0x10028c1); +pub const SYM_braille_dots_278: KeySym = KeySym(0x10028c2); +pub const SYM_braille_dots_1278: KeySym = KeySym(0x10028c3); +pub const SYM_braille_dots_378: KeySym = KeySym(0x10028c4); +pub const SYM_braille_dots_1378: KeySym = KeySym(0x10028c5); +pub const SYM_braille_dots_2378: KeySym = KeySym(0x10028c6); +pub const SYM_braille_dots_12378: KeySym = KeySym(0x10028c7); +pub const SYM_braille_dots_478: KeySym = KeySym(0x10028c8); +pub const SYM_braille_dots_1478: KeySym = KeySym(0x10028c9); +pub const SYM_braille_dots_2478: KeySym = KeySym(0x10028ca); +pub const SYM_braille_dots_12478: KeySym = KeySym(0x10028cb); +pub const SYM_braille_dots_3478: KeySym = KeySym(0x10028cc); +pub const SYM_braille_dots_13478: KeySym = KeySym(0x10028cd); +pub const SYM_braille_dots_23478: KeySym = KeySym(0x10028ce); +pub const SYM_braille_dots_123478: KeySym = KeySym(0x10028cf); +pub const SYM_braille_dots_578: KeySym = KeySym(0x10028d0); +pub const SYM_braille_dots_1578: KeySym = KeySym(0x10028d1); +pub const SYM_braille_dots_2578: KeySym = KeySym(0x10028d2); +pub const SYM_braille_dots_12578: KeySym = KeySym(0x10028d3); +pub const SYM_braille_dots_3578: KeySym = KeySym(0x10028d4); +pub const SYM_braille_dots_13578: KeySym = KeySym(0x10028d5); +pub const SYM_braille_dots_23578: KeySym = KeySym(0x10028d6); +pub const SYM_braille_dots_123578: KeySym = KeySym(0x10028d7); +pub const SYM_braille_dots_4578: KeySym = KeySym(0x10028d8); +pub const SYM_braille_dots_14578: KeySym = KeySym(0x10028d9); +pub const SYM_braille_dots_24578: KeySym = KeySym(0x10028da); +pub const SYM_braille_dots_124578: KeySym = KeySym(0x10028db); +pub const SYM_braille_dots_34578: KeySym = KeySym(0x10028dc); +pub const SYM_braille_dots_134578: KeySym = KeySym(0x10028dd); +pub const SYM_braille_dots_234578: KeySym = KeySym(0x10028de); +pub const SYM_braille_dots_1234578: KeySym = KeySym(0x10028df); +pub const SYM_braille_dots_678: KeySym = KeySym(0x10028e0); +pub const SYM_braille_dots_1678: KeySym = KeySym(0x10028e1); +pub const SYM_braille_dots_2678: KeySym = KeySym(0x10028e2); +pub const SYM_braille_dots_12678: KeySym = KeySym(0x10028e3); +pub const SYM_braille_dots_3678: KeySym = KeySym(0x10028e4); +pub const SYM_braille_dots_13678: KeySym = KeySym(0x10028e5); +pub const SYM_braille_dots_23678: KeySym = KeySym(0x10028e6); +pub const SYM_braille_dots_123678: KeySym = KeySym(0x10028e7); +pub const SYM_braille_dots_4678: KeySym = KeySym(0x10028e8); +pub const SYM_braille_dots_14678: KeySym = KeySym(0x10028e9); +pub const SYM_braille_dots_24678: KeySym = KeySym(0x10028ea); +pub const SYM_braille_dots_124678: KeySym = KeySym(0x10028eb); +pub const SYM_braille_dots_34678: KeySym = KeySym(0x10028ec); +pub const SYM_braille_dots_134678: KeySym = KeySym(0x10028ed); +pub const SYM_braille_dots_234678: KeySym = KeySym(0x10028ee); +pub const SYM_braille_dots_1234678: KeySym = KeySym(0x10028ef); +pub const SYM_braille_dots_5678: KeySym = KeySym(0x10028f0); +pub const SYM_braille_dots_15678: KeySym = KeySym(0x10028f1); +pub const SYM_braille_dots_25678: KeySym = KeySym(0x10028f2); +pub const SYM_braille_dots_125678: KeySym = KeySym(0x10028f3); +pub const SYM_braille_dots_35678: KeySym = KeySym(0x10028f4); +pub const SYM_braille_dots_135678: KeySym = KeySym(0x10028f5); +pub const SYM_braille_dots_235678: KeySym = KeySym(0x10028f6); +pub const SYM_braille_dots_1235678: KeySym = KeySym(0x10028f7); +pub const SYM_braille_dots_45678: KeySym = KeySym(0x10028f8); +pub const SYM_braille_dots_145678: KeySym = KeySym(0x10028f9); +pub const SYM_braille_dots_245678: KeySym = KeySym(0x10028fa); +pub const SYM_braille_dots_1245678: KeySym = KeySym(0x10028fb); +pub const SYM_braille_dots_345678: KeySym = KeySym(0x10028fc); +pub const SYM_braille_dots_1345678: KeySym = KeySym(0x10028fd); +pub const SYM_braille_dots_2345678: KeySym = KeySym(0x10028fe); +pub const SYM_braille_dots_12345678: KeySym = KeySym(0x10028ff); +pub const SYM_Sinh_ng: KeySym = KeySym(0x1000d82); +pub const SYM_Sinh_h2: KeySym = KeySym(0x1000d83); +pub const SYM_Sinh_a: KeySym = KeySym(0x1000d85); +pub const SYM_Sinh_aa: KeySym = KeySym(0x1000d86); +pub const SYM_Sinh_ae: KeySym = KeySym(0x1000d87); +pub const SYM_Sinh_aee: KeySym = KeySym(0x1000d88); +pub const SYM_Sinh_i: KeySym = KeySym(0x1000d89); +pub const SYM_Sinh_ii: KeySym = KeySym(0x1000d8a); +pub const SYM_Sinh_u: KeySym = KeySym(0x1000d8b); +pub const SYM_Sinh_uu: KeySym = KeySym(0x1000d8c); +pub const SYM_Sinh_ri: KeySym = KeySym(0x1000d8d); +pub const SYM_Sinh_rii: KeySym = KeySym(0x1000d8e); +pub const SYM_Sinh_lu: KeySym = KeySym(0x1000d8f); +pub const SYM_Sinh_luu: KeySym = KeySym(0x1000d90); +pub const SYM_Sinh_e: KeySym = KeySym(0x1000d91); +pub const SYM_Sinh_ee: KeySym = KeySym(0x1000d92); +pub const SYM_Sinh_ai: KeySym = KeySym(0x1000d93); +pub const SYM_Sinh_o: KeySym = KeySym(0x1000d94); +pub const SYM_Sinh_oo: KeySym = KeySym(0x1000d95); +pub const SYM_Sinh_au: KeySym = KeySym(0x1000d96); +pub const SYM_Sinh_ka: KeySym = KeySym(0x1000d9a); +pub const SYM_Sinh_kha: KeySym = KeySym(0x1000d9b); +pub const SYM_Sinh_ga: KeySym = KeySym(0x1000d9c); +pub const SYM_Sinh_gha: KeySym = KeySym(0x1000d9d); +pub const SYM_Sinh_ng2: KeySym = KeySym(0x1000d9e); +pub const SYM_Sinh_nga: KeySym = KeySym(0x1000d9f); +pub const SYM_Sinh_ca: KeySym = KeySym(0x1000da0); +pub const SYM_Sinh_cha: KeySym = KeySym(0x1000da1); +pub const SYM_Sinh_ja: KeySym = KeySym(0x1000da2); +pub const SYM_Sinh_jha: KeySym = KeySym(0x1000da3); +pub const SYM_Sinh_nya: KeySym = KeySym(0x1000da4); +pub const SYM_Sinh_jnya: KeySym = KeySym(0x1000da5); +pub const SYM_Sinh_nja: KeySym = KeySym(0x1000da6); +pub const SYM_Sinh_tta: KeySym = KeySym(0x1000da7); +pub const SYM_Sinh_ttha: KeySym = KeySym(0x1000da8); +pub const SYM_Sinh_dda: KeySym = KeySym(0x1000da9); +pub const SYM_Sinh_ddha: KeySym = KeySym(0x1000daa); +pub const SYM_Sinh_nna: KeySym = KeySym(0x1000dab); +pub const SYM_Sinh_ndda: KeySym = KeySym(0x1000dac); +pub const SYM_Sinh_tha: KeySym = KeySym(0x1000dad); +pub const SYM_Sinh_thha: KeySym = KeySym(0x1000dae); +pub const SYM_Sinh_dha: KeySym = KeySym(0x1000daf); +pub const SYM_Sinh_dhha: KeySym = KeySym(0x1000db0); +pub const SYM_Sinh_na: KeySym = KeySym(0x1000db1); +pub const SYM_Sinh_ndha: KeySym = KeySym(0x1000db3); +pub const SYM_Sinh_pa: KeySym = KeySym(0x1000db4); +pub const SYM_Sinh_pha: KeySym = KeySym(0x1000db5); +pub const SYM_Sinh_ba: KeySym = KeySym(0x1000db6); +pub const SYM_Sinh_bha: KeySym = KeySym(0x1000db7); +pub const SYM_Sinh_ma: KeySym = KeySym(0x1000db8); +pub const SYM_Sinh_mba: KeySym = KeySym(0x1000db9); +pub const SYM_Sinh_ya: KeySym = KeySym(0x1000dba); +pub const SYM_Sinh_ra: KeySym = KeySym(0x1000dbb); +pub const SYM_Sinh_la: KeySym = KeySym(0x1000dbd); +pub const SYM_Sinh_va: KeySym = KeySym(0x1000dc0); +pub const SYM_Sinh_sha: KeySym = KeySym(0x1000dc1); +pub const SYM_Sinh_ssha: KeySym = KeySym(0x1000dc2); +pub const SYM_Sinh_sa: KeySym = KeySym(0x1000dc3); +pub const SYM_Sinh_ha: KeySym = KeySym(0x1000dc4); +pub const SYM_Sinh_lla: KeySym = KeySym(0x1000dc5); +pub const SYM_Sinh_fa: KeySym = KeySym(0x1000dc6); +pub const SYM_Sinh_al: KeySym = KeySym(0x1000dca); +pub const SYM_Sinh_aa2: KeySym = KeySym(0x1000dcf); +pub const SYM_Sinh_ae2: KeySym = KeySym(0x1000dd0); +pub const SYM_Sinh_aee2: KeySym = KeySym(0x1000dd1); +pub const SYM_Sinh_i2: KeySym = KeySym(0x1000dd2); +pub const SYM_Sinh_ii2: KeySym = KeySym(0x1000dd3); +pub const SYM_Sinh_u2: KeySym = KeySym(0x1000dd4); +pub const SYM_Sinh_uu2: KeySym = KeySym(0x1000dd6); +pub const SYM_Sinh_ru2: KeySym = KeySym(0x1000dd8); +pub const SYM_Sinh_e2: KeySym = KeySym(0x1000dd9); +pub const SYM_Sinh_ee2: KeySym = KeySym(0x1000dda); +pub const SYM_Sinh_ai2: KeySym = KeySym(0x1000ddb); +pub const SYM_Sinh_o2: KeySym = KeySym(0x1000ddc); +pub const SYM_Sinh_oo2: KeySym = KeySym(0x1000ddd); +pub const SYM_Sinh_au2: KeySym = KeySym(0x1000dde); +pub const SYM_Sinh_lu2: KeySym = KeySym(0x1000ddf); +pub const SYM_Sinh_ruu2: KeySym = KeySym(0x1000df2); +pub const SYM_Sinh_luu2: KeySym = KeySym(0x1000df3); +pub const SYM_Sinh_kunddaliya: KeySym = KeySym(0x1000df4); +pub const SYM_XF86ModeLock: KeySym = KeySym(0x1008FF01); +pub const SYM_XF86MonBrightnessUp: KeySym = KeySym(0x1008FF02); +pub const SYM_XF86MonBrightnessDown: KeySym = KeySym(0x1008FF03); +pub const SYM_XF86KbdLightOnOff: KeySym = KeySym(0x1008FF04); +pub const SYM_XF86KbdBrightnessUp: KeySym = KeySym(0x1008FF05); +pub const SYM_XF86KbdBrightnessDown: KeySym = KeySym(0x1008FF06); +pub const SYM_XF86MonBrightnessCycle: KeySym = KeySym(0x1008FF07); +pub const SYM_XF86Standby: KeySym = KeySym(0x1008FF10); +pub const SYM_XF86AudioLowerVolume: KeySym = KeySym(0x1008FF11); +pub const SYM_XF86AudioMute: KeySym = KeySym(0x1008FF12); +pub const SYM_XF86AudioRaiseVolume: KeySym = KeySym(0x1008FF13); +pub const SYM_XF86AudioPlay: KeySym = KeySym(0x1008FF14); +pub const SYM_XF86AudioStop: KeySym = KeySym(0x1008FF15); +pub const SYM_XF86AudioPrev: KeySym = KeySym(0x1008FF16); +pub const SYM_XF86AudioNext: KeySym = KeySym(0x1008FF17); +pub const SYM_XF86HomePage: KeySym = KeySym(0x1008FF18); +pub const SYM_XF86Mail: KeySym = KeySym(0x1008FF19); +pub const SYM_XF86Start: KeySym = KeySym(0x1008FF1A); +pub const SYM_XF86Search: KeySym = KeySym(0x1008FF1B); +pub const SYM_XF86AudioRecord: KeySym = KeySym(0x1008FF1C); +pub const SYM_XF86Calculator: KeySym = KeySym(0x1008FF1D); +pub const SYM_XF86Memo: KeySym = KeySym(0x1008FF1E); +pub const SYM_XF86ToDoList: KeySym = KeySym(0x1008FF1F); +pub const SYM_XF86Calendar: KeySym = KeySym(0x1008FF20); +pub const SYM_XF86PowerDown: KeySym = KeySym(0x1008FF21); +pub const SYM_XF86ContrastAdjust: KeySym = KeySym(0x1008FF22); +pub const SYM_XF86RockerUp: KeySym = KeySym(0x1008FF23); +pub const SYM_XF86RockerDown: KeySym = KeySym(0x1008FF24); +pub const SYM_XF86RockerEnter: KeySym = KeySym(0x1008FF25); +pub const SYM_XF86Back: KeySym = KeySym(0x1008FF26); +pub const SYM_XF86Forward: KeySym = KeySym(0x1008FF27); +pub const SYM_XF86Stop: KeySym = KeySym(0x1008FF28); +pub const SYM_XF86Refresh: KeySym = KeySym(0x1008FF29); +pub const SYM_XF86PowerOff: KeySym = KeySym(0x1008FF2A); +pub const SYM_XF86WakeUp: KeySym = KeySym(0x1008FF2B); +pub const SYM_XF86Eject: KeySym = KeySym(0x1008FF2C); +pub const SYM_XF86ScreenSaver: KeySym = KeySym(0x1008FF2D); +pub const SYM_XF86WWW: KeySym = KeySym(0x1008FF2E); +pub const SYM_XF86Sleep: KeySym = KeySym(0x1008FF2F); +pub const SYM_XF86Favorites: KeySym = KeySym(0x1008FF30); +pub const SYM_XF86AudioPause: KeySym = KeySym(0x1008FF31); +pub const SYM_XF86AudioMedia: KeySym = KeySym(0x1008FF32); +pub const SYM_XF86MyComputer: KeySym = KeySym(0x1008FF33); +pub const SYM_XF86VendorHome: KeySym = KeySym(0x1008FF34); +pub const SYM_XF86LightBulb: KeySym = KeySym(0x1008FF35); +pub const SYM_XF86Shop: KeySym = KeySym(0x1008FF36); +pub const SYM_XF86History: KeySym = KeySym(0x1008FF37); +pub const SYM_XF86OpenURL: KeySym = KeySym(0x1008FF38); +pub const SYM_XF86AddFavorite: KeySym = KeySym(0x1008FF39); +pub const SYM_XF86HotLinks: KeySym = KeySym(0x1008FF3A); +pub const SYM_XF86BrightnessAdjust: KeySym = KeySym(0x1008FF3B); +pub const SYM_XF86Finance: KeySym = KeySym(0x1008FF3C); +pub const SYM_XF86Community: KeySym = KeySym(0x1008FF3D); +pub const SYM_XF86AudioRewind: KeySym = KeySym(0x1008FF3E); +pub const SYM_XF86BackForward: KeySym = KeySym(0x1008FF3F); +pub const SYM_XF86Launch0: KeySym = KeySym(0x1008FF40); +pub const SYM_XF86Launch1: KeySym = KeySym(0x1008FF41); +pub const SYM_XF86Launch2: KeySym = KeySym(0x1008FF42); +pub const SYM_XF86Launch3: KeySym = KeySym(0x1008FF43); +pub const SYM_XF86Launch4: KeySym = KeySym(0x1008FF44); +pub const SYM_XF86Launch5: KeySym = KeySym(0x1008FF45); +pub const SYM_XF86Launch6: KeySym = KeySym(0x1008FF46); +pub const SYM_XF86Launch7: KeySym = KeySym(0x1008FF47); +pub const SYM_XF86Launch8: KeySym = KeySym(0x1008FF48); +pub const SYM_XF86Launch9: KeySym = KeySym(0x1008FF49); +pub const SYM_XF86LaunchA: KeySym = KeySym(0x1008FF4A); +pub const SYM_XF86LaunchB: KeySym = KeySym(0x1008FF4B); +pub const SYM_XF86LaunchC: KeySym = KeySym(0x1008FF4C); +pub const SYM_XF86LaunchD: KeySym = KeySym(0x1008FF4D); +pub const SYM_XF86LaunchE: KeySym = KeySym(0x1008FF4E); +pub const SYM_XF86LaunchF: KeySym = KeySym(0x1008FF4F); +pub const SYM_XF86ApplicationLeft: KeySym = KeySym(0x1008FF50); +pub const SYM_XF86ApplicationRight: KeySym = KeySym(0x1008FF51); +pub const SYM_XF86Book: KeySym = KeySym(0x1008FF52); +pub const SYM_XF86CD: KeySym = KeySym(0x1008FF53); +pub const SYM_XF86Calculater: KeySym = KeySym(0x1008FF54); +pub const SYM_XF86Clear: KeySym = KeySym(0x1008FF55); +pub const SYM_XF86Close: KeySym = KeySym(0x1008FF56); +pub const SYM_XF86Copy: KeySym = KeySym(0x1008FF57); +pub const SYM_XF86Cut: KeySym = KeySym(0x1008FF58); +pub const SYM_XF86Display: KeySym = KeySym(0x1008FF59); +pub const SYM_XF86DOS: KeySym = KeySym(0x1008FF5A); +pub const SYM_XF86Documents: KeySym = KeySym(0x1008FF5B); +pub const SYM_XF86Excel: KeySym = KeySym(0x1008FF5C); +pub const SYM_XF86Explorer: KeySym = KeySym(0x1008FF5D); +pub const SYM_XF86Game: KeySym = KeySym(0x1008FF5E); +pub const SYM_XF86Go: KeySym = KeySym(0x1008FF5F); +pub const SYM_XF86iTouch: KeySym = KeySym(0x1008FF60); +pub const SYM_XF86LogOff: KeySym = KeySym(0x1008FF61); +pub const SYM_XF86Market: KeySym = KeySym(0x1008FF62); +pub const SYM_XF86Meeting: KeySym = KeySym(0x1008FF63); +pub const SYM_XF86MenuKB: KeySym = KeySym(0x1008FF65); +pub const SYM_XF86MenuPB: KeySym = KeySym(0x1008FF66); +pub const SYM_XF86MySites: KeySym = KeySym(0x1008FF67); +pub const SYM_XF86New: KeySym = KeySym(0x1008FF68); +pub const SYM_XF86News: KeySym = KeySym(0x1008FF69); +pub const SYM_XF86OfficeHome: KeySym = KeySym(0x1008FF6A); +pub const SYM_XF86Open: KeySym = KeySym(0x1008FF6B); +pub const SYM_XF86Option: KeySym = KeySym(0x1008FF6C); +pub const SYM_XF86Paste: KeySym = KeySym(0x1008FF6D); +pub const SYM_XF86Phone: KeySym = KeySym(0x1008FF6E); +pub const SYM_XF86Q: KeySym = KeySym(0x1008FF70); +pub const SYM_XF86Reply: KeySym = KeySym(0x1008FF72); +pub const SYM_XF86Reload: KeySym = KeySym(0x1008FF73); +pub const SYM_XF86RotateWindows: KeySym = KeySym(0x1008FF74); +pub const SYM_XF86RotationPB: KeySym = KeySym(0x1008FF75); +pub const SYM_XF86RotationKB: KeySym = KeySym(0x1008FF76); +pub const SYM_XF86Save: KeySym = KeySym(0x1008FF77); +pub const SYM_XF86ScrollUp: KeySym = KeySym(0x1008FF78); +pub const SYM_XF86ScrollDown: KeySym = KeySym(0x1008FF79); +pub const SYM_XF86ScrollClick: KeySym = KeySym(0x1008FF7A); +pub const SYM_XF86Send: KeySym = KeySym(0x1008FF7B); +pub const SYM_XF86Spell: KeySym = KeySym(0x1008FF7C); +pub const SYM_XF86SplitScreen: KeySym = KeySym(0x1008FF7D); +pub const SYM_XF86Support: KeySym = KeySym(0x1008FF7E); +pub const SYM_XF86TaskPane: KeySym = KeySym(0x1008FF7F); +pub const SYM_XF86Terminal: KeySym = KeySym(0x1008FF80); +pub const SYM_XF86Tools: KeySym = KeySym(0x1008FF81); +pub const SYM_XF86Travel: KeySym = KeySym(0x1008FF82); +pub const SYM_XF86UserPB: KeySym = KeySym(0x1008FF84); +pub const SYM_XF86User1KB: KeySym = KeySym(0x1008FF85); +pub const SYM_XF86User2KB: KeySym = KeySym(0x1008FF86); +pub const SYM_XF86Video: KeySym = KeySym(0x1008FF87); +pub const SYM_XF86WheelButton: KeySym = KeySym(0x1008FF88); +pub const SYM_XF86Word: KeySym = KeySym(0x1008FF89); +pub const SYM_XF86Xfer: KeySym = KeySym(0x1008FF8A); +pub const SYM_XF86ZoomIn: KeySym = KeySym(0x1008FF8B); +pub const SYM_XF86ZoomOut: KeySym = KeySym(0x1008FF8C); +pub const SYM_XF86Away: KeySym = KeySym(0x1008FF8D); +pub const SYM_XF86Messenger: KeySym = KeySym(0x1008FF8E); +pub const SYM_XF86WebCam: KeySym = KeySym(0x1008FF8F); +pub const SYM_XF86MailForward: KeySym = KeySym(0x1008FF90); +pub const SYM_XF86Pictures: KeySym = KeySym(0x1008FF91); +pub const SYM_XF86Music: KeySym = KeySym(0x1008FF92); +pub const SYM_XF86Battery: KeySym = KeySym(0x1008FF93); +pub const SYM_XF86Bluetooth: KeySym = KeySym(0x1008FF94); +pub const SYM_XF86WLAN: KeySym = KeySym(0x1008FF95); +pub const SYM_XF86UWB: KeySym = KeySym(0x1008FF96); +pub const SYM_XF86AudioForward: KeySym = KeySym(0x1008FF97); +pub const SYM_XF86AudioRepeat: KeySym = KeySym(0x1008FF98); +pub const SYM_XF86AudioRandomPlay: KeySym = KeySym(0x1008FF99); +pub const SYM_XF86Subtitle: KeySym = KeySym(0x1008FF9A); +pub const SYM_XF86AudioCycleTrack: KeySym = KeySym(0x1008FF9B); +pub const SYM_XF86CycleAngle: KeySym = KeySym(0x1008FF9C); +pub const SYM_XF86FrameBack: KeySym = KeySym(0x1008FF9D); +pub const SYM_XF86FrameForward: KeySym = KeySym(0x1008FF9E); +pub const SYM_XF86Time: KeySym = KeySym(0x1008FF9F); +pub const SYM_XF86Select: KeySym = KeySym(0x1008FFA0); +pub const SYM_XF86View: KeySym = KeySym(0x1008FFA1); +pub const SYM_XF86TopMenu: KeySym = KeySym(0x1008FFA2); +pub const SYM_XF86Red: KeySym = KeySym(0x1008FFA3); +pub const SYM_XF86Green: KeySym = KeySym(0x1008FFA4); +pub const SYM_XF86Yellow: KeySym = KeySym(0x1008FFA5); +pub const SYM_XF86Blue: KeySym = KeySym(0x1008FFA6); +pub const SYM_XF86Suspend: KeySym = KeySym(0x1008FFA7); +pub const SYM_XF86Hibernate: KeySym = KeySym(0x1008FFA8); +pub const SYM_XF86TouchpadToggle: KeySym = KeySym(0x1008FFA9); +pub const SYM_XF86TouchpadOn: KeySym = KeySym(0x1008FFB0); +pub const SYM_XF86TouchpadOff: KeySym = KeySym(0x1008FFB1); +pub const SYM_XF86AudioMicMute: KeySym = KeySym(0x1008FFB2); +pub const SYM_XF86Keyboard: KeySym = KeySym(0x1008FFB3); +pub const SYM_XF86WWAN: KeySym = KeySym(0x1008FFB4); +pub const SYM_XF86RFKill: KeySym = KeySym(0x1008FFB5); +pub const SYM_XF86AudioPreset: KeySym = KeySym(0x1008FFB6); +pub const SYM_XF86RotationLockToggle: KeySym = KeySym(0x1008FFB7); +pub const SYM_XF86FullScreen: KeySym = KeySym(0x1008FFB8); +pub const SYM_XF86Switch_VT_1: KeySym = KeySym(0x1008FE01); +pub const SYM_XF86Switch_VT_2: KeySym = KeySym(0x1008FE02); +pub const SYM_XF86Switch_VT_3: KeySym = KeySym(0x1008FE03); +pub const SYM_XF86Switch_VT_4: KeySym = KeySym(0x1008FE04); +pub const SYM_XF86Switch_VT_5: KeySym = KeySym(0x1008FE05); +pub const SYM_XF86Switch_VT_6: KeySym = KeySym(0x1008FE06); +pub const SYM_XF86Switch_VT_7: KeySym = KeySym(0x1008FE07); +pub const SYM_XF86Switch_VT_8: KeySym = KeySym(0x1008FE08); +pub const SYM_XF86Switch_VT_9: KeySym = KeySym(0x1008FE09); +pub const SYM_XF86Switch_VT_10: KeySym = KeySym(0x1008FE0A); +pub const SYM_XF86Switch_VT_11: KeySym = KeySym(0x1008FE0B); +pub const SYM_XF86Switch_VT_12: KeySym = KeySym(0x1008FE0C); +pub const SYM_XF86Ungrab: KeySym = KeySym(0x1008FE20); +pub const SYM_XF86ClearGrab: KeySym = KeySym(0x1008FE21); +pub const SYM_XF86Next_VMode: KeySym = KeySym(0x1008FE22); +pub const SYM_XF86Prev_VMode: KeySym = KeySym(0x1008FE23); +pub const SYM_XF86LogWindowTree: KeySym = KeySym(0x1008FE24); +pub const SYM_XF86LogGrabInfo: KeySym = KeySym(0x1008FE25); +pub const SYM_XF86BrightnessAuto: KeySym = KeySym(0x100810f4); +pub const SYM_XF86DisplayOff: KeySym = KeySym(0x100810f5); +pub const SYM_XF86Info: KeySym = KeySym(0x10081166); +pub const SYM_XF86AspectRatio: KeySym = KeySym(0x10081177); +pub const SYM_XF86DVD: KeySym = KeySym(0x10081185); +pub const SYM_XF86Audio: KeySym = KeySym(0x10081188); +pub const SYM_XF86ChannelUp: KeySym = KeySym(0x10081192); +pub const SYM_XF86ChannelDown: KeySym = KeySym(0x10081193); +pub const SYM_XF86Break: KeySym = KeySym(0x1008119b); +pub const SYM_XF86VideoPhone: KeySym = KeySym(0x100811a0); +pub const SYM_XF86ZoomReset: KeySym = KeySym(0x100811a4); +pub const SYM_XF86Editor: KeySym = KeySym(0x100811a6); +pub const SYM_XF86GraphicsEditor: KeySym = KeySym(0x100811a8); +pub const SYM_XF86Presentation: KeySym = KeySym(0x100811a9); +pub const SYM_XF86Database: KeySym = KeySym(0x100811aa); +pub const SYM_XF86Voicemail: KeySym = KeySym(0x100811ac); +pub const SYM_XF86Addressbook: KeySym = KeySym(0x100811ad); +pub const SYM_XF86DisplayToggle: KeySym = KeySym(0x100811af); +pub const SYM_XF86SpellCheck: KeySym = KeySym(0x100811b0); +pub const SYM_XF86ContextMenu: KeySym = KeySym(0x100811b6); +pub const SYM_XF86MediaRepeat: KeySym = KeySym(0x100811b7); +pub const SYM_XF8610ChannelsUp: KeySym = KeySym(0x100811b8); +pub const SYM_XF8610ChannelsDown: KeySym = KeySym(0x100811b9); +pub const SYM_XF86Images: KeySym = KeySym(0x100811ba); +pub const SYM_XF86NotificationCenter: KeySym = KeySym(0x100811bc); +pub const SYM_XF86PickupPhone: KeySym = KeySym(0x100811bd); +pub const SYM_XF86HangupPhone: KeySym = KeySym(0x100811be); +pub const SYM_XF86Fn: KeySym = KeySym(0x100811d0); +pub const SYM_XF86Fn_Esc: KeySym = KeySym(0x100811d1); +pub const SYM_XF86FnRightShift: KeySym = KeySym(0x100811e5); +pub const SYM_XF86Numeric0: KeySym = KeySym(0x10081200); +pub const SYM_XF86Numeric1: KeySym = KeySym(0x10081201); +pub const SYM_XF86Numeric2: KeySym = KeySym(0x10081202); +pub const SYM_XF86Numeric3: KeySym = KeySym(0x10081203); +pub const SYM_XF86Numeric4: KeySym = KeySym(0x10081204); +pub const SYM_XF86Numeric5: KeySym = KeySym(0x10081205); +pub const SYM_XF86Numeric6: KeySym = KeySym(0x10081206); +pub const SYM_XF86Numeric7: KeySym = KeySym(0x10081207); +pub const SYM_XF86Numeric8: KeySym = KeySym(0x10081208); +pub const SYM_XF86Numeric9: KeySym = KeySym(0x10081209); +pub const SYM_XF86NumericStar: KeySym = KeySym(0x1008120a); +pub const SYM_XF86NumericPound: KeySym = KeySym(0x1008120b); +pub const SYM_XF86NumericA: KeySym = KeySym(0x1008120c); +pub const SYM_XF86NumericB: KeySym = KeySym(0x1008120d); +pub const SYM_XF86NumericC: KeySym = KeySym(0x1008120e); +pub const SYM_XF86NumericD: KeySym = KeySym(0x1008120f); +pub const SYM_XF86CameraFocus: KeySym = KeySym(0x10081210); +pub const SYM_XF86WPSButton: KeySym = KeySym(0x10081211); +pub const SYM_XF86CameraZoomIn: KeySym = KeySym(0x10081215); +pub const SYM_XF86CameraZoomOut: KeySym = KeySym(0x10081216); +pub const SYM_XF86CameraUp: KeySym = KeySym(0x10081217); +pub const SYM_XF86CameraDown: KeySym = KeySym(0x10081218); +pub const SYM_XF86CameraLeft: KeySym = KeySym(0x10081219); +pub const SYM_XF86CameraRight: KeySym = KeySym(0x1008121a); +pub const SYM_XF86AttendantOn: KeySym = KeySym(0x1008121b); +pub const SYM_XF86AttendantOff: KeySym = KeySym(0x1008121c); +pub const SYM_XF86AttendantToggle: KeySym = KeySym(0x1008121d); +pub const SYM_XF86LightsToggle: KeySym = KeySym(0x1008121e); +pub const SYM_XF86ALSToggle: KeySym = KeySym(0x10081230); +pub const SYM_XF86Buttonconfig: KeySym = KeySym(0x10081240); +pub const SYM_XF86Taskmanager: KeySym = KeySym(0x10081241); +pub const SYM_XF86Journal: KeySym = KeySym(0x10081242); +pub const SYM_XF86ControlPanel: KeySym = KeySym(0x10081243); +pub const SYM_XF86AppSelect: KeySym = KeySym(0x10081244); +pub const SYM_XF86Screensaver: KeySym = KeySym(0x10081245); +pub const SYM_XF86VoiceCommand: KeySym = KeySym(0x10081246); +pub const SYM_XF86Assistant: KeySym = KeySym(0x10081247); +pub const SYM_XF86BrightnessMin: KeySym = KeySym(0x10081250); +pub const SYM_XF86BrightnessMax: KeySym = KeySym(0x10081251); +pub const SYM_XF86KbdInputAssistPrev: KeySym = KeySym(0x10081260); +pub const SYM_XF86KbdInputAssistNext: KeySym = KeySym(0x10081261); +pub const SYM_XF86KbdInputAssistPrevgroup: KeySym = KeySym(0x10081262); +pub const SYM_XF86KbdInputAssistNextgroup: KeySym = KeySym(0x10081263); +pub const SYM_XF86KbdInputAssistAccept: KeySym = KeySym(0x10081264); +pub const SYM_XF86KbdInputAssistCancel: KeySym = KeySym(0x10081265); +pub const SYM_XF86RightUp: KeySym = KeySym(0x10081266); +pub const SYM_XF86RightDown: KeySym = KeySym(0x10081267); +pub const SYM_XF86LeftUp: KeySym = KeySym(0x10081268); +pub const SYM_XF86LeftDown: KeySym = KeySym(0x10081269); +pub const SYM_XF86RootMenu: KeySym = KeySym(0x1008126a); +pub const SYM_XF86MediaTopMenu: KeySym = KeySym(0x1008126b); +pub const SYM_XF86Numeric11: KeySym = KeySym(0x1008126c); +pub const SYM_XF86Numeric12: KeySym = KeySym(0x1008126d); +pub const SYM_XF86AudioDesc: KeySym = KeySym(0x1008126e); +pub const SYM_XF863DMode: KeySym = KeySym(0x1008126f); +pub const SYM_XF86NextFavorite: KeySym = KeySym(0x10081270); +pub const SYM_XF86StopRecord: KeySym = KeySym(0x10081271); +pub const SYM_XF86PauseRecord: KeySym = KeySym(0x10081272); +pub const SYM_XF86VOD: KeySym = KeySym(0x10081273); +pub const SYM_XF86Unmute: KeySym = KeySym(0x10081274); +pub const SYM_XF86FastReverse: KeySym = KeySym(0x10081275); +pub const SYM_XF86SlowReverse: KeySym = KeySym(0x10081276); +pub const SYM_XF86Data: KeySym = KeySym(0x10081277); +pub const SYM_XF86OnScreenKeyboard: KeySym = KeySym(0x10081278); +pub const SYM_XF86PrivacyScreenToggle: KeySym = KeySym(0x10081279); +pub const SYM_XF86SelectiveScreenshot: KeySym = KeySym(0x1008127a); +pub const SYM_XF86Macro1: KeySym = KeySym(0x10081290); +pub const SYM_XF86Macro2: KeySym = KeySym(0x10081291); +pub const SYM_XF86Macro3: KeySym = KeySym(0x10081292); +pub const SYM_XF86Macro4: KeySym = KeySym(0x10081293); +pub const SYM_XF86Macro5: KeySym = KeySym(0x10081294); +pub const SYM_XF86Macro6: KeySym = KeySym(0x10081295); +pub const SYM_XF86Macro7: KeySym = KeySym(0x10081296); +pub const SYM_XF86Macro8: KeySym = KeySym(0x10081297); +pub const SYM_XF86Macro9: KeySym = KeySym(0x10081298); +pub const SYM_XF86Macro10: KeySym = KeySym(0x10081299); +pub const SYM_XF86Macro11: KeySym = KeySym(0x1008129a); +pub const SYM_XF86Macro12: KeySym = KeySym(0x1008129b); +pub const SYM_XF86Macro13: KeySym = KeySym(0x1008129c); +pub const SYM_XF86Macro14: KeySym = KeySym(0x1008129d); +pub const SYM_XF86Macro15: KeySym = KeySym(0x1008129e); +pub const SYM_XF86Macro16: KeySym = KeySym(0x1008129f); +pub const SYM_XF86Macro17: KeySym = KeySym(0x100812a0); +pub const SYM_XF86Macro18: KeySym = KeySym(0x100812a1); +pub const SYM_XF86Macro19: KeySym = KeySym(0x100812a2); +pub const SYM_XF86Macro20: KeySym = KeySym(0x100812a3); +pub const SYM_XF86Macro21: KeySym = KeySym(0x100812a4); +pub const SYM_XF86Macro22: KeySym = KeySym(0x100812a5); +pub const SYM_XF86Macro23: KeySym = KeySym(0x100812a6); +pub const SYM_XF86Macro24: KeySym = KeySym(0x100812a7); +pub const SYM_XF86Macro25: KeySym = KeySym(0x100812a8); +pub const SYM_XF86Macro26: KeySym = KeySym(0x100812a9); +pub const SYM_XF86Macro27: KeySym = KeySym(0x100812aa); +pub const SYM_XF86Macro28: KeySym = KeySym(0x100812ab); +pub const SYM_XF86Macro29: KeySym = KeySym(0x100812ac); +pub const SYM_XF86Macro30: KeySym = KeySym(0x100812ad); +pub const SYM_XF86MacroRecordStart: KeySym = KeySym(0x100812b0); +pub const SYM_XF86MacroRecordStop: KeySym = KeySym(0x100812b1); +pub const SYM_XF86MacroPresetCycle: KeySym = KeySym(0x100812b2); +pub const SYM_XF86MacroPreset1: KeySym = KeySym(0x100812b3); +pub const SYM_XF86MacroPreset2: KeySym = KeySym(0x100812b4); +pub const SYM_XF86MacroPreset3: KeySym = KeySym(0x100812b5); +pub const SYM_XF86KbdLcdMenu1: KeySym = KeySym(0x100812b8); +pub const SYM_XF86KbdLcdMenu2: KeySym = KeySym(0x100812b9); +pub const SYM_XF86KbdLcdMenu3: KeySym = KeySym(0x100812ba); +pub const SYM_XF86KbdLcdMenu4: KeySym = KeySym(0x100812bb); +pub const SYM_XF86KbdLcdMenu5: KeySym = KeySym(0x100812bc); +pub const SYM_SunFA_Grave: KeySym = KeySym(0x1005FF00); +pub const SYM_SunFA_Circum: KeySym = KeySym(0x1005FF01); +pub const SYM_SunFA_Tilde: KeySym = KeySym(0x1005FF02); +pub const SYM_SunFA_Acute: KeySym = KeySym(0x1005FF03); +pub const SYM_SunFA_Diaeresis: KeySym = KeySym(0x1005FF04); +pub const SYM_SunFA_Cedilla: KeySym = KeySym(0x1005FF05); +pub const SYM_SunF36: KeySym = KeySym(0x1005FF10); +pub const SYM_SunF37: KeySym = KeySym(0x1005FF11); +pub const SYM_SunSys_Req: KeySym = KeySym(0x1005FF60); +pub const SYM_SunPrint_Screen: KeySym = KeySym(0x0000FF61); +pub const SYM_SunCompose: KeySym = KeySym(0x0000FF20); +pub const SYM_SunAltGraph: KeySym = KeySym(0x0000FF7E); +pub const SYM_SunPageUp: KeySym = KeySym(0x0000FF55); +pub const SYM_SunPageDown: KeySym = KeySym(0x0000FF56); +pub const SYM_SunUndo: KeySym = KeySym(0x0000FF65); +pub const SYM_SunAgain: KeySym = KeySym(0x0000FF66); +pub const SYM_SunFind: KeySym = KeySym(0x0000FF68); +pub const SYM_SunStop: KeySym = KeySym(0x0000FF69); +pub const SYM_SunProps: KeySym = KeySym(0x1005FF70); +pub const SYM_SunFront: KeySym = KeySym(0x1005FF71); +pub const SYM_SunCopy: KeySym = KeySym(0x1005FF72); +pub const SYM_SunOpen: KeySym = KeySym(0x1005FF73); +pub const SYM_SunPaste: KeySym = KeySym(0x1005FF74); +pub const SYM_SunCut: KeySym = KeySym(0x1005FF75); +pub const SYM_SunPowerSwitch: KeySym = KeySym(0x1005FF76); +pub const SYM_SunAudioLowerVolume: KeySym = KeySym(0x1005FF77); +pub const SYM_SunAudioMute: KeySym = KeySym(0x1005FF78); +pub const SYM_SunAudioRaiseVolume: KeySym = KeySym(0x1005FF79); +pub const SYM_SunVideoDegauss: KeySym = KeySym(0x1005FF7A); +pub const SYM_SunVideoLowerBrightness: KeySym = KeySym(0x1005FF7B); +pub const SYM_SunVideoRaiseBrightness: KeySym = KeySym(0x1005FF7C); +pub const SYM_SunPowerSwitchShift: KeySym = KeySym(0x1005FF7D); +pub const SYM_Dring_accent: KeySym = KeySym(0x1000FEB0); +pub const SYM_Dcircumflex_accent: KeySym = KeySym(0x1000FE5E); +pub const SYM_Dcedilla_accent: KeySym = KeySym(0x1000FE2C); +pub const SYM_Dacute_accent: KeySym = KeySym(0x1000FE27); +pub const SYM_Dgrave_accent: KeySym = KeySym(0x1000FE60); +pub const SYM_Dtilde: KeySym = KeySym(0x1000FE7E); +pub const SYM_Ddiaeresis: KeySym = KeySym(0x1000FE22); +pub const SYM_DRemove: KeySym = KeySym(0x1000FF00); +pub const SYM_hpClearLine: KeySym = KeySym(0x1000FF6F); +pub const SYM_hpInsertLine: KeySym = KeySym(0x1000FF70); +pub const SYM_hpDeleteLine: KeySym = KeySym(0x1000FF71); +pub const SYM_hpInsertChar: KeySym = KeySym(0x1000FF72); +pub const SYM_hpDeleteChar: KeySym = KeySym(0x1000FF73); +pub const SYM_hpBackTab: KeySym = KeySym(0x1000FF74); +pub const SYM_hpKP_BackTab: KeySym = KeySym(0x1000FF75); +pub const SYM_hpModelock1: KeySym = KeySym(0x1000FF48); +pub const SYM_hpModelock2: KeySym = KeySym(0x1000FF49); +pub const SYM_hpReset: KeySym = KeySym(0x1000FF6C); +pub const SYM_hpSystem: KeySym = KeySym(0x1000FF6D); +pub const SYM_hpUser: KeySym = KeySym(0x1000FF6E); +pub const SYM_hpmute_acute: KeySym = KeySym(0x100000A8); +pub const SYM_hpmute_grave: KeySym = KeySym(0x100000A9); +pub const SYM_hpmute_asciicircum: KeySym = KeySym(0x100000AA); +pub const SYM_hpmute_diaeresis: KeySym = KeySym(0x100000AB); +pub const SYM_hpmute_asciitilde: KeySym = KeySym(0x100000AC); +pub const SYM_hplira: KeySym = KeySym(0x100000AF); +pub const SYM_hpguilder: KeySym = KeySym(0x100000BE); +pub const SYM_hpYdiaeresis: KeySym = KeySym(0x100000EE); +pub const SYM_hpIO: KeySym = KeySym(0x100000EE); +pub const SYM_hplongminus: KeySym = KeySym(0x100000F6); +pub const SYM_hpblock: KeySym = KeySym(0x100000FC); +pub const SYM_osfCopy: KeySym = KeySym(0x1004FF02); +pub const SYM_osfCut: KeySym = KeySym(0x1004FF03); +pub const SYM_osfPaste: KeySym = KeySym(0x1004FF04); +pub const SYM_osfBackTab: KeySym = KeySym(0x1004FF07); +pub const SYM_osfBackSpace: KeySym = KeySym(0x1004FF08); +pub const SYM_osfClear: KeySym = KeySym(0x1004FF0B); +pub const SYM_osfEscape: KeySym = KeySym(0x1004FF1B); +pub const SYM_osfAddMode: KeySym = KeySym(0x1004FF31); +pub const SYM_osfPrimaryPaste: KeySym = KeySym(0x1004FF32); +pub const SYM_osfQuickPaste: KeySym = KeySym(0x1004FF33); +pub const SYM_osfPageLeft: KeySym = KeySym(0x1004FF40); +pub const SYM_osfPageUp: KeySym = KeySym(0x1004FF41); +pub const SYM_osfPageDown: KeySym = KeySym(0x1004FF42); +pub const SYM_osfPageRight: KeySym = KeySym(0x1004FF43); +pub const SYM_osfActivate: KeySym = KeySym(0x1004FF44); +pub const SYM_osfMenuBar: KeySym = KeySym(0x1004FF45); +pub const SYM_osfLeft: KeySym = KeySym(0x1004FF51); +pub const SYM_osfUp: KeySym = KeySym(0x1004FF52); +pub const SYM_osfRight: KeySym = KeySym(0x1004FF53); +pub const SYM_osfDown: KeySym = KeySym(0x1004FF54); +pub const SYM_osfEndLine: KeySym = KeySym(0x1004FF57); +pub const SYM_osfBeginLine: KeySym = KeySym(0x1004FF58); +pub const SYM_osfEndData: KeySym = KeySym(0x1004FF59); +pub const SYM_osfBeginData: KeySym = KeySym(0x1004FF5A); +pub const SYM_osfPrevMenu: KeySym = KeySym(0x1004FF5B); +pub const SYM_osfNextMenu: KeySym = KeySym(0x1004FF5C); +pub const SYM_osfPrevField: KeySym = KeySym(0x1004FF5D); +pub const SYM_osfNextField: KeySym = KeySym(0x1004FF5E); +pub const SYM_osfSelect: KeySym = KeySym(0x1004FF60); +pub const SYM_osfInsert: KeySym = KeySym(0x1004FF63); +pub const SYM_osfUndo: KeySym = KeySym(0x1004FF65); +pub const SYM_osfMenu: KeySym = KeySym(0x1004FF67); +pub const SYM_osfCancel: KeySym = KeySym(0x1004FF69); +pub const SYM_osfHelp: KeySym = KeySym(0x1004FF6A); +pub const SYM_osfSelectAll: KeySym = KeySym(0x1004FF71); +pub const SYM_osfDeselectAll: KeySym = KeySym(0x1004FF72); +pub const SYM_osfReselect: KeySym = KeySym(0x1004FF73); +pub const SYM_osfExtend: KeySym = KeySym(0x1004FF74); +pub const SYM_osfRestore: KeySym = KeySym(0x1004FF78); +pub const SYM_osfDelete: KeySym = KeySym(0x1004FFFF); +pub const SYM_Reset: KeySym = KeySym(0x1000FF6C); +pub const SYM_System: KeySym = KeySym(0x1000FF6D); +pub const SYM_User: KeySym = KeySym(0x1000FF6E); +pub const SYM_ClearLine: KeySym = KeySym(0x1000FF6F); +pub const SYM_InsertLine: KeySym = KeySym(0x1000FF70); +pub const SYM_DeleteLine: KeySym = KeySym(0x1000FF71); +pub const SYM_InsertChar: KeySym = KeySym(0x1000FF72); +pub const SYM_DeleteChar: KeySym = KeySym(0x1000FF73); +pub const SYM_BackTab: KeySym = KeySym(0x1000FF74); +pub const SYM_KP_BackTab: KeySym = KeySym(0x1000FF75); +pub const SYM_Ext16bit_L: KeySym = KeySym(0x1000FF76); +pub const SYM_Ext16bit_R: KeySym = KeySym(0x1000FF77); +pub const SYM_mute_acute: KeySym = KeySym(0x100000a8); +pub const SYM_mute_grave: KeySym = KeySym(0x100000a9); +pub const SYM_mute_asciicircum: KeySym = KeySym(0x100000aa); +pub const SYM_mute_diaeresis: KeySym = KeySym(0x100000ab); +pub const SYM_mute_asciitilde: KeySym = KeySym(0x100000ac); +pub const SYM_lira: KeySym = KeySym(0x100000af); +pub const SYM_guilder: KeySym = KeySym(0x100000be); +pub const SYM_IO: KeySym = KeySym(0x100000ee); +pub const SYM_longminus: KeySym = KeySym(0x100000f6); +pub const SYM_block: KeySym = KeySym(0x100000fc); diff --git a/i4config/src/lib.rs b/i4config/src/lib.rs new file mode 100644 index 00000000..3c0b24a1 --- /dev/null +++ b/i4config/src/lib.rs @@ -0,0 +1,131 @@ +#![feature(thread_local_const_init)] + +use crate::keyboard::ModifiedKeySym; +use bincode::{Decode, Encode}; +use crate::keyboard::keymap::Keymap; + +#[macro_use] +mod macros; +#[doc(hidden)] +pub mod _private; +pub mod keyboard; + +#[derive(Encode, Decode, Copy, Clone, Debug)] +pub enum LogLevel { + Error, + Warn, + Info, + Debug, + Trace, +} + +#[derive(Encode, Decode, Copy, Clone, Debug)] +pub enum Direction { + Left, + Down, + Up, + Right, +} + +#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)] +pub struct Seat(pub u64); + +impl Seat { + pub const INVALID: Self = Self(0); + + pub fn is_invalid(self) -> bool { + self == Self::INVALID + } +} + +#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)] +pub struct Keyboard(pub u64); + +#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)] +pub struct Mouse(pub u64); + +#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)] +pub enum InputDevice { + Keyboard(Keyboard), + Mouse(Mouse), +} + +impl InputDevice { + pub fn set_seat(self, seat: Seat) { + get!().set_seat(self, seat) + } +} + +impl Seat { + #[doc(hidden)] + pub fn raw(self) -> u64 { + self.0 + } + + #[doc(hidden)] + pub fn from_raw(raw: u64) -> Self { + Self(raw) + } + + pub fn bind, F: Fn() + 'static>(self, mod_sym: T, f: F) { + get!().bind(self, mod_sym, f) + } + + pub fn unbind>(self, mod_sym: T) { + get!().unbind(self, mod_sym) + } + + pub fn focus(self, direction: Direction) { + get!().focus(self, direction) + } + + pub fn move_(self, direction: Direction) { + get!().move_(self, direction) + } + + pub fn set_keymap(self, keymap: Keymap) { + get!().seat_set_keymap(self, keymap) + } + + pub fn set_repeat_rate(self, rate: i32, delay: i32) { + get!().seat_set_repeat_rate(self, rate, delay) + } + + pub fn repeat_rate(self) -> (i32, i32) { + let mut res = (25, 250); + (|| res = get!().seat_get_repeat_rate(self))(); + res + } +} + +pub fn get_seats() -> Vec { + let mut res = vec![]; + (|| res = get!().seats())(); + res +} + +pub fn input_devices() -> Vec { + let mut res = vec![]; + (|| res = get!().get_input_devices())(); + res +} + +pub fn remove_all_seats() {} + +pub fn create_seat(name: &str) -> Seat { + let mut res = Seat(0); + (|| res = get!().create_seat(name))(); + res +} + +pub fn on_new_seat(f: F) { + get!().on_new_seat(f) +} + +pub fn on_new_input_device(f: F) { + get!().on_new_input_device(f) +} + +pub fn shell(shell: &str) { + get!().shell(shell) +} diff --git a/i4config/src/macros.rs b/i4config/src/macros.rs new file mode 100644 index 00000000..6f4707de --- /dev/null +++ b/i4config/src/macros.rs @@ -0,0 +1,68 @@ +#[macro_export] +macro_rules! config { + ($f:path) => { + #[no_mangle] + #[used] + pub static mut I4_CONFIG_ENTRY: $crate::_private::ConfigEntry = { + struct X; + impl $crate::_private::Config for X { + extern "C" fn configure() { + $f(); + } + } + $crate::_private::ConfigEntryGen::::ENTRY + }; + }; +} + +macro_rules! get { + () => {{ + #[allow(unused_unsafe)] + let client = unsafe { + let client = crate::_private::client::CLIENT.with(|client| client.get()); + if client.is_null() { + return; + } + &*client + }; + client + }}; +} + +// #[macro_export] +// macro_rules! log { +// ($lvl:expr, $($arg:tt)+) => ({ +// $crate::log( +// $lvl, +// &format!($($args)*), +// ); +// }) +// } +// +// #[macro_export] +// macro_rules! trace { +// ($($arg:tt)+) => { +// $crate::log!($crate::LogLevel::Trace, $($arg)+) +// } +// } +// +// #[macro_export] +// macro_rules! debug { +// ($($arg:tt)+) => { +// $crate::log!($crate::LogLevel::Debug, $($arg)+) +// } +// } +// +// #[macro_export] +// macro_rules! info { +// ($($arg:tt)+) => { +// $crate::log!($crate::LogLevel::Info, $($arg)+) +// } +// } +// +// #[macro_export] +// macro_rules! info { +// ($($arg:tt)+) => { +// $crate::log!($crate::LogLevel::Info, $($arg)+) +// } +// } diff --git a/src/backend.rs b/src/backend.rs index c3b2148d..2d2886f4 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -3,7 +3,8 @@ use std::fmt::Debug; use std::rc::Rc; linear_ids!(OutputIds, OutputId); -linear_ids!(SeatIds, SeatId); +linear_ids!(KeyboardIds, KeyboardId); +linear_ids!(MouseIds, MouseId); pub trait Output { fn id(&self) -> OutputId; @@ -13,16 +14,24 @@ pub trait Output { fn on_change(&self, cb: Rc); } -pub trait Seat { - fn id(&self) -> SeatId; +pub trait Keyboard { + fn id(&self) -> KeyboardId; fn removed(&self) -> bool; - fn event(&self) -> Option; + fn event(&self) -> Option; + fn on_change(&self, cb: Rc); +} + +pub trait Mouse { + fn id(&self) -> MouseId; + fn removed(&self) -> bool; + fn event(&self) -> Option; fn on_change(&self, cb: Rc); } pub enum BackendEvent { NewOutput(Rc), - NewSeat(Rc), + NewKeyboard(Rc), + NewMouse(Rc), } #[derive(Debug, Copy, Clone, Eq, PartialEq)] @@ -38,11 +47,15 @@ pub enum ScrollAxis { } #[derive(Debug)] -pub enum SeatEvent { +pub enum KeyboardEvent { + Key(u32, KeyState), +} + +#[derive(Debug)] +pub enum MouseEvent { OutputPosition(OutputId, Fixed, Fixed), #[allow(dead_code)] Motion(Fixed, Fixed), Button(u32, KeyState), Scroll(i32, ScrollAxis), - Key(u32, KeyState), } diff --git a/src/backends/xorg/mod.rs b/src/backends/xorg.rs similarity index 93% rename from src/backends/xorg/mod.rs rename to src/backends/xorg.rs index bae99ad4..2eafc807 100644 --- a/src/backends/xorg/mod.rs +++ b/src/backends/xorg.rs @@ -1,6 +1,4 @@ -use crate::backend::{ - BackendEvent, KeyState, Output, OutputId, ScrollAxis, Seat, SeatEvent, SeatId, -}; +use crate::backend::{BackendEvent, Keyboard, KeyboardEvent, KeyboardId, KeyState, Mouse, MouseEvent, MouseId, Output, OutputId, ScrollAxis}; use crate::drm::drm::{Drm, DrmError}; use crate::drm::gbm::{GbmDevice, GbmError, GBM_BO_USE_RENDERING}; use crate::drm::{ModifiedFormat, INVALID_MODIFIER}; @@ -519,14 +517,15 @@ impl XorgBackend { } fn handle_input_device(self: &Rc, info: &ffi::xcb_input_xi_device_info_t) { - if info.type_ != ffi::XCB_INPUT_DEVICE_TYPE_MASTER_KEYBOARD as _ { + if info.type_ != ffi::XCB_INPUT_DEVICE_TYPE_MASTER_KEYBOARD as u16 { return; } let con = &self.con; self.mouse_seats.remove(&info.attachment); if let Some(kb) = self.seats.remove(&info.deviceid) { kb.removed.set(true); - kb.changed(); + kb.kb_changed(); + kb.mouse_changed(); } unsafe { let mut err = ptr::null_mut(); @@ -550,13 +549,16 @@ impl XorgBackend { ); } let seat = Rc::new(XorgSeat { - id: self.state.seat_ids.next(), + kb_id: self.state.kb_ids.next(), + mouse_id: self.state.mouse_ids.next(), backend: self.clone(), _kb: info.deviceid, mouse: info.attachment, removed: Cell::new(false), - cb: CloneCell::new(None), - events: RefCell::new(Default::default()), + kb_cb: Default::default(), + mouse_cb: Default::default(), + kb_events: RefCell::new(Default::default()), + mouse_events: RefCell::new(Default::default()), button_map: Default::default(), }); seat.update_button_map(); @@ -564,7 +566,10 @@ impl XorgBackend { self.mouse_seats.set(info.attachment, seat.clone()); self.state .backend_events - .push(BackendEvent::NewSeat(seat.clone())); + .push(BackendEvent::NewMouse(seat.clone())); + self.state + .backend_events + .push(BackendEvent::NewKeyboard(seat.clone())); } } @@ -756,7 +761,7 @@ impl XorgBackend { 7 => (ScrollAxis::Horizontal, 15), _ => unreachable!(), }; - seat.event(SeatEvent::Scroll(val, axis)); + seat.mouse_event(MouseEvent::Scroll(val, axis)); } } else { const BTN_LEFT: u32 = 0x110; @@ -770,7 +775,7 @@ impl XorgBackend { 3 => BTN_RIGHT, n => BTN_SIDE + n - 8, }; - seat.event(SeatEvent::Button(button, state)); + seat.mouse_event(MouseEvent::Button(button, state)); } } Ok(()) @@ -790,7 +795,7 @@ impl XorgBackend { let event = unsafe { (event as *const _ as *const ffi::xcb_input_key_press_event_t).deref() }; if let Some(seat) = self.seats.get(&event.deviceid) { - seat.event(SeatEvent::Key(event.detail - 8, state)); + seat.kb_event(KeyboardEvent::Key(event.detail - 8, state)); } Ok(()) } @@ -816,7 +821,8 @@ impl XorgBackend { self.mouse_seats.remove(&info.attachment); if let Some(seat) = self.seats.remove(&info.deviceid) { seat.removed.set(true); - seat.changed(); + seat.kb_changed(); + seat.mouse_changed(); } } } @@ -832,7 +838,7 @@ impl XorgBackend { self.outputs.get(&event.event), self.mouse_seats.get(&event.deviceid), ) { - seat.event(SeatEvent::OutputPosition( + seat.mouse_event(MouseEvent::OutputPosition( win.id, Fixed::from_1616(event.event_x), Fixed::from_1616(event.event_y), @@ -853,7 +859,7 @@ impl XorgBackend { (Some(a), Some(b)) => (a, b), _ => return Ok(()), }; - seat.event(SeatEvent::OutputPosition( + seat.mouse_event(MouseEvent::OutputPosition( win.id, Fixed::from_1616(event.event_x), Fixed::from_1616(event.event_y), @@ -986,26 +992,40 @@ impl Output for XorgOutput { } struct XorgSeat { - id: SeatId, + kb_id: KeyboardId, + mouse_id: MouseId, backend: Rc, _kb: ffi::xcb_input_device_id_t, mouse: ffi::xcb_input_device_id_t, removed: Cell, - cb: CloneCell>>, - events: RefCell>, + kb_cb: CloneCell>>, + mouse_cb: CloneCell>>, + kb_events: RefCell>, + mouse_events: RefCell>, button_map: CopyHashMap, } impl XorgSeat { - fn changed(&self) { - if let Some(cb) = self.cb.get() { + fn kb_changed(&self) { + if let Some(cb) = self.kb_cb.get() { cb(); } } - fn event(&self, event: SeatEvent) { - self.events.borrow_mut().push_back(event); - self.changed(); + fn mouse_changed(&self) { + if let Some(cb) = self.mouse_cb.get() { + cb(); + } + } + + fn mouse_event(&self, event: MouseEvent) { + self.mouse_events.borrow_mut().push_back(event); + self.mouse_changed(); + } + + fn kb_event(&self, event: KeyboardEvent) { + self.kb_events.borrow_mut().push_back(event); + self.kb_changed(); } fn update_button_map(&self) { @@ -1041,20 +1061,38 @@ impl XorgSeat { } } -impl Seat for XorgSeat { - fn id(&self) -> SeatId { - self.id +impl Keyboard for XorgSeat { + fn id(&self) -> KeyboardId { + self.kb_id } fn removed(&self) -> bool { self.removed.get() } - fn event(&self) -> Option { - self.events.borrow_mut().pop_front() + fn event(&self) -> Option { + self.kb_events.borrow_mut().pop_front() } fn on_change(&self, cb: Rc) { - self.cb.set(Some(cb)); + self.kb_cb.set(Some(cb)); + } +} + +impl Mouse for XorgSeat { + fn id(&self) -> MouseId { + self.mouse_id + } + + fn removed(&self) -> bool { + self.removed.get() + } + + fn event(&self) -> Option { + self.mouse_events.borrow_mut().pop_front() + } + + fn on_change(&self, cb: Rc) { + self.mouse_cb.set(Some(cb)); } } diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 00000000..f667e5fa --- /dev/null +++ b/src/config.rs @@ -0,0 +1,154 @@ +mod handler; + +use crate::backend::{KeyboardId, MouseId}; +use crate::utils::ptr_ext::PtrExt; +use crate::{NumCell, State}; +use i4config::_private::ipc::{InitMessage, Request, V1InitMessage}; +use i4config::_private::{bincode_ops, ConfigEntry, VERSION}; +use i4config::keyboard::ModifiedKeySym; +use libloading::Library; +use std::cell::Cell; +use std::ptr; +use std::rc::Rc; +use thiserror::Error; +use i4config::{InputDevice, Keyboard, Mouse, Seat}; +use crate::config::handler::ConfigProxyHandler; +use crate::ifs::wl_seat::{SeatId}; + +#[derive(Debug, Error)] +pub enum ConfigError { + #[error("Could not load the config library")] + CouldNotLoadLibrary(#[source] libloading::Error), + #[error("Config library does not contain the entry symbol")] + LibraryDoesNotContainEntry(#[source] libloading::Error), +} + +pub struct ConfigProxy { + handler: Rc, +} + +impl ConfigProxy { + pub fn invoke_shortcut(&self, seat: SeatId, modsym: &ModifiedKeySym) { + self.handler.send(&Request::InvokeShortcut { + seat: Seat(seat.raw() as _), + mods: modsym.mods, + sym: modsym.sym, + }); + } + + pub fn new_keyboard(&self, kb: KeyboardId) { + self.handler.send(&Request::NewInputDevice { + device: InputDevice::Keyboard(Keyboard(kb.raw() as _)), + }); + } + + pub fn new_mouse(&self, mouse: MouseId) { + self.handler.send(&Request::NewInputDevice { + device: InputDevice::Mouse(Mouse(mouse.raw() as _)), + }); + } + + pub fn del_keyboard(&self, kb: KeyboardId) { + self.handler.send(&Request::DelInputDevice { + device: InputDevice::Keyboard(Keyboard(kb.raw() as _)), + }); + } + + pub fn del_mouse(&self, mouse: MouseId) { + self.handler.send(&Request::DelInputDevice { + device: InputDevice::Mouse(Mouse(mouse.raw() as _)), + }); + } +} + +impl Drop for ConfigProxy { + fn drop(&mut self) { + unsafe { + self.handler.dropped.set(true); + (self.handler.unref)(self.handler.client_data.get()); + } + } +} + +unsafe extern "C" fn default_client_init( + srv_data: *const u8, + srv_unref: unsafe extern "C" fn(data: *const u8), + srv_handler: unsafe extern "C" fn(data: *const u8, msg: *const u8, size: usize), + msg: *const u8, + size: usize, +) -> *const u8 { + extern "C" fn configure() { + default_config::configure(); + } + i4config::_private::client::init(srv_data, srv_unref, srv_handler, msg, size, configure) +} + +impl ConfigProxy { + fn new(lib: Option, entry: &ConfigEntry, state: &Rc) -> Self { + let version = entry.version.min(VERSION); + let data = Rc::new(ConfigProxyHandler { + client_data: Cell::new(ptr::null()), + dropped: Cell::new(false), + _lib: lib, + _version: version, + unref: entry.unref, + handle_msg: entry.handle_msg, + state: state.clone(), + next_id: NumCell::new(1), + keymaps: Default::default(), + bufs: Default::default(), + }); + let init_msg = + bincode::encode_to_vec(&InitMessage::V1(V1InitMessage {}), bincode_ops()).unwrap(); + unsafe { + let client_data = (entry.init)( + Rc::into_raw(data.clone()) as _, + unref, + handle_msg, + init_msg.as_ptr(), + init_msg.len(), + ); + data.client_data.set(client_data); + } + data.send(&Request::Configure); + Self { handler: data } + } + + pub fn default(state: &Rc) -> Self { + let entry = ConfigEntry { + version: VERSION, + init: default_client_init, + unref: i4config::_private::client::unref, + handle_msg: i4config::_private::client::handle_msg, + }; + Self::new(None, &entry, state) + } + + #[allow(dead_code)] + pub unsafe fn from_file(path: &str, state: &Rc) -> Result { + let lib = match Library::new(path) { + Ok(l) => l, + Err(e) => return Err(ConfigError::CouldNotLoadLibrary(e)), + }; + let entry = lib.get::<&'static ConfigEntry>(b"I4_CONFIG_ENTRY\0"); + let entry = match entry { + Ok(e) => *e, + Err(e) => return Err(ConfigError::LibraryDoesNotContainEntry(e)), + }; + Ok(Self::new(Some(lib), entry, state)) + } +} + +unsafe extern "C" fn unref(data: *const u8) { + let server = data as *const ConfigProxyHandler; + drop(Rc::from_raw(server)); +} + +unsafe extern "C" fn handle_msg(data: *const u8, msg: *const u8, size: usize) { + let server = (data as *const ConfigProxyHandler).deref(); + if server.dropped.get() { + return; + } + let msg = std::slice::from_raw_parts(msg, size); + server.handle_request(msg); +} diff --git a/src/config/handler.rs b/src/config/handler.rs new file mode 100644 index 00000000..26d5ff95 --- /dev/null +++ b/src/config/handler.rs @@ -0,0 +1,370 @@ +use std::cell::{Cell}; +use std::rc::Rc; +use bincode::error::DecodeError; +use libloading::Library; +use log::Level; +use thiserror::Error; +use i4config::_private::bincode_ops; +use i4config::_private::ipc::{Request, Response}; +use i4config::keyboard::keymap::Keymap; +use i4config::{Direction, InputDevice, Keyboard, LogLevel, Mouse, Seat}; +use i4config::keyboard::mods::Modifiers; +use i4config::keyboard::syms::KeySym; +use crate::{ErrorFmt, NumCell, State}; +use crate::backend::{KeyboardId, MouseId}; +use crate::ifs::wl_seat::WlSeatGlobal; +use crate::state::DeviceHandlerData; +use crate::utils::copyhashmap::CopyHashMap; +use crate::utils::debug_fn::debug_fn; +use crate::utils::stack::Stack; +use crate::xkbcommon::XkbKeymap; + +pub(super) struct ConfigProxyHandler { + pub client_data: Cell<*const u8>, + pub dropped: Cell, + pub _lib: Option, + pub _version: u32, + pub unref: unsafe extern "C" fn(data: *const u8), + pub handle_msg: unsafe extern "C" fn(data: *const u8, msg: *const u8, size: usize), + pub state: Rc, + pub next_id: NumCell, + pub keymaps: CopyHashMap>, + pub bufs: Stack>, +} + +impl ConfigProxyHandler { + pub fn send(&self, msg: &Request) { + let mut buf = self.bufs.pop().unwrap_or_default(); + buf.clear(); + bincode::encode_into_std_write(msg, &mut buf, bincode_ops()).unwrap(); + unsafe { + (self.handle_msg)(self.client_data.get(), buf.as_ptr(), buf.len()); + } + self.bufs.push(buf); + } + + fn id(&self) -> u64 { + self.next_id.fetch_add(1) + } + + fn handle_log_request(&self, level: LogLevel, msg: &str, file: Option<&str>, line: Option) -> Result<(), LogError> { + let level = match level { + LogLevel::Error => Level::Error, + LogLevel::Warn => Level::Warn, + LogLevel::Info => Level::Info, + LogLevel::Debug => Level::Debug, + LogLevel::Trace => Level::Trace, + }; + let debug = debug_fn(|fmt| { + if let Some(file) = file { + write!(fmt, "{}", file)?; + if let Some(line) = line { + write!(fmt, ":{}", line)?; + } + write!(fmt, ": ")?; + } + write!(fmt, "{}", msg)?; + Ok(()) + }); + log::log!(level, "{:?}", debug); + Ok(()) + } + + fn handle_create_seat(&self, name: &str) -> Result<(), CreateSeatError> { + let global_name = self.state.globals.name(); + let seat = WlSeatGlobal::new(global_name, name, &self.state); + self.state.globals.add_global(&self.state, &seat); + self.send(&Request::Response { + response: Response::CreateSeat { + seat: Seat(seat.id().raw() as _), + } + }); + Ok(()) + } + + fn handle_parse_keymap(&self, keymap: &str) -> Result<(), ParseKeymapError> { + let (keymap, res) = match self.state.xkb_ctx.keymap_from_str(keymap) { + Ok(keymap) => { + let id = Keymap(self.id()); + self.keymaps.set(id, keymap); + (id, Ok(())) + } + _ => { + (Keymap::INVALID, Err(ParseKeymapError::ParsingFailed)) + } + }; + self.send(&Request::Response { response: Response::ParseKeymap { keymap } }); + res + } + + fn handle_set_keymap(&self, seat: Seat, keymap: Keymap) -> Result<(), SeatSetKeymapError> { + let seat = self.get_seat(seat)?; + let keymap = if keymap.is_invalid() { + self.state.default_keymap.clone() + } else { + self.get_keymap(keymap)? + }; + seat.set_keymap(&keymap); + Ok(()) + } + + fn handle_focus(&self, seat: Seat, direction: Direction) -> Result<(), FocusError> { + let seat = self.get_seat(seat)?; + seat.move_focus(direction); + Ok(()) + } + + fn handle_get_repeat_rate(&self, seat: Seat) -> Result<(), SeatGetRepeatRateError> { + let seat = self.get_seat(seat)?; + let (rate, delay) = seat.get_rate(); + self.send(&Request::Response { + response: Response::GetRepeatRate { + rate, + delay, + }, + }); + Ok(()) + } + + fn handle_set_repeat_rate(&self, seat: Seat, rate: i32, delay: i32) -> Result<(), SeatSetRepeatRateError> { + let seat = self.get_seat(seat)?; + if rate < 0 { + return Err(SeatSetRepeatRateError::NegativeRate); + } + if delay < 0 { + return Err(SeatSetRepeatRateError::NegativeDelay); + } + seat.set_rate(rate, delay); + Ok(()) + } + + fn get_device_handler_data(&self, device: InputDevice) -> Result, CphError> { + let data = match device { + InputDevice::Keyboard(kb) => { + self.state.kb_handlers.borrow_mut().get(&KeyboardId::from_raw(kb.0 as _)).map(|d| d.data.clone()) + }, + InputDevice::Mouse(mouse) => { + self.state.mouse_handlers.borrow_mut().get(&MouseId::from_raw(mouse.0 as _)).map(|d| d.data.clone()) + } + }; + match data { + Some(d) => Ok(d), + _ => Err(CphError::DeviceDoesNotExist(device)), + } + } + + fn get_seat(&self, seat: Seat) -> Result, CphError> { + let seats = self.state.globals.seats.lock(); + for seat_global in seats.values() { + if seat_global.id().raw() == seat.0 as _ { + return Ok(seat_global.clone()); + } + } + Err(CphError::SeatDoesNotExist(seat)) + } + + fn get_keymap(&self, keymap: Keymap) -> Result, CphError> { + match self.keymaps.get(&keymap) { + Some(k) => Ok(k), + None => Err(CphError::KeymapDoesNotExist(keymap)), + } + } + + fn handle_set_seat(&self, device: InputDevice, seat: Seat) -> Result<(), SetSeatError> { + let seat = if seat.is_invalid() { + None + } else { + Some(self.get_seat(seat)?) + }; + let dev = self.get_device_handler_data(device)?; + dev.seat.set(seat); + Ok(()) + } + + fn handle_add_shortcut(&self, seat: Seat, mods: Modifiers, sym: KeySym) -> Result<(), AddShortcutError> { + let seat = self.get_seat(seat)?; + seat.add_shortcut(mods, sym); + Ok(()) + } + + fn handle_get_input_devices(&self) -> Result<(), GetInputDevicesError> { + let mut res = vec!(); + { + let devs = self.state.kb_handlers.borrow_mut(); + for dev in devs.values() { + res.push(InputDevice::Keyboard(Keyboard(dev.id.raw() as _))); + } + } + { + let devs = self.state.mouse_handlers.borrow_mut(); + for dev in devs.values() { + res.push(InputDevice::Mouse(Mouse(dev.id.raw() as _))); + } + } + self.send(&Request::Response { + response: Response::GetInputDevices { devices: res }, + }); + Ok(()) + } + + fn handle_get_seats(&self) -> Result<(), GetSeatsError> { + let seats = { + let seats = self.state.globals.seats.lock(); + seats + .values() + .map(|seat| Seat::from_raw(seat.id().raw() as _)) + .collect() + }; + self.send(&Request::Response { + response: Response::GetSeats { seats }, + }); + Ok(()) + } + + pub fn handle_request(&self, msg: &[u8]) { + if let Err(e) = self.handle_request_(msg) { + log::error!("Could not handle client request: {}", ErrorFmt(e)); + } + } + + fn handle_request_(&self, msg: &[u8]) -> Result<(), CphError> { + let (request, _) = match bincode::decode_from_slice::(msg, bincode_ops()) { + Ok(msg) => msg, + Err(e) => return Err(CphError::ParsingFailed(e)), + }; + match request { + Request::Log { + level, + msg, + file, + line, + } => self.handle_log_request(level, msg, file, line)?, + Request::CreateSeat { name } => self.handle_create_seat(name)?, + Request::ParseKeymap { keymap } => self.handle_parse_keymap(keymap)?, + Request::SeatSetKeymap { seat, keymap } => self.handle_set_keymap(seat, keymap)?, + Request::SeatGetRepeatRate { seat } => self.handle_get_repeat_rate(seat)?, + Request::SeatSetRepeatRate { seat, rate, delay } => self.handle_set_repeat_rate(seat, rate, delay)?, + Request::SetSeat { device, seat } => self.handle_set_seat(device, seat)?, + Request::AddShortcut { + seat, + mods, + sym, + } => self.handle_add_shortcut(seat, mods, sym)?, + Request::RemoveShortcut { .. } => {} + Request::Focus { seat, direction } => self.handle_focus(seat, direction)?, + Request::Move { seat, direction } => {} + Request::GetInputDevices => self.handle_get_input_devices()?, + Request::GetSeats => self.handle_get_seats()?, + m => return Err(CphError::UnexpectedMessage(format!("{:?}", m))), + } + Ok(()) + } +} + +#[derive(Debug, Error)] +enum CphError { + #[error("Could not process a `log` request")] + LogError(#[from] LogError), + #[error("Could not process a `create_seat` request")] + CreateSeatError(#[from] CreateSeatError), + #[error("Could not process a `parse_keymap` request")] + ParseKeymapError(#[from] ParseKeymapError), + #[error("Could not process a `set_seat` request")] + SetSeatError(#[from] SetSeatError), + #[error("Could not process a `add_shortcut` request")] + AddShortcutError(#[from] AddShortcutError), + #[error("Could not process a `get_input_devices` request")] + GetInputDevicesError(#[from] GetInputDevicesError), + #[error("Could not process a `get_seats` request")] + GetSeatsError(#[from] GetSeatsError), + #[error("Could not process a `set_keymap` request")] + SeatSetKeymapError(#[from] SeatSetKeymapError), + #[error("Could not process a `get_repeat_rate` request")] + SeatGetRepeatRateError(#[from] SeatGetRepeatRateError), + #[error("Could not process a `set_repeat_rate` request")] + SeatSetRepeatRateError(#[from] SeatSetRepeatRateError), + #[error("Could not process a `focus` request")] + FocusError(#[from] FocusError), + #[error("Device {0:?} does not exist")] + DeviceDoesNotExist(InputDevice), + #[error("Device {0:?} does not exist")] + KeymapDoesNotExist(Keymap), + #[error("Seat {0:?} does not exist")] + SeatDoesNotExist(Seat), + #[error("Seat {0:?} does not exist")] + UnexpectedMessage(String), + #[error("Could not parse the message")] + ParsingFailed(#[source] DecodeError), +} + +#[derive(Debug, Error)] +enum LogError { + +} + +#[derive(Debug, Error)] +enum CreateSeatError { + +} + +#[derive(Debug, Error)] +enum ParseKeymapError { + #[error("Parsing failed")] + ParsingFailed, +} + +#[derive(Debug, Error)] +enum SetSeatError { + #[error(transparent)] + CphError(#[from] Box), +} +efrom!(SetSeatError, CphError); + +#[derive(Debug, Error)] +enum AddShortcutError { + #[error(transparent)] + CphError(#[from] Box), +} +efrom!(AddShortcutError, CphError); + +#[derive(Debug, Error)] +enum GetInputDevicesError { + +} + +#[derive(Debug, Error)] +enum GetSeatsError { + +} + +#[derive(Debug, Error)] +enum SeatSetKeymapError { + #[error(transparent)] + CphError(#[from] Box), +} +efrom!(SeatSetKeymapError, CphError); + +#[derive(Debug, Error)] +enum SeatSetRepeatRateError { + #[error(transparent)] + CphError(#[from] Box), + #[error("Rate is negative")] + NegativeRate, + #[error("Delay is negative")] + NegativeDelay, +} +efrom!(SeatSetRepeatRateError, CphError); + +#[derive(Debug, Error)] +enum SeatGetRepeatRateError { + #[error(transparent)] + CphError(#[from] Box), +} +efrom!(SeatGetRepeatRateError, CphError); + +#[derive(Debug, Error)] +enum FocusError { + #[error(transparent)] + CphError(#[from] Box), +} +efrom!(FocusError, CphError); diff --git a/src/ifs/wl_seat.rs b/src/ifs/wl_seat.rs index 0715ba56..a8d62fbd 100644 --- a/src/ifs/wl_seat.rs +++ b/src/ifs/wl_seat.rs @@ -4,7 +4,6 @@ pub mod wl_keyboard; pub mod wl_pointer; pub mod wl_touch; -use crate::backend::{Seat, SeatId}; use crate::client::{Client, ClientError, ClientId}; use crate::cursor::{Cursor, KnownCursor}; use crate::fixed::Fixed; @@ -29,24 +28,25 @@ use crate::utils::buffd::MsgParser; use crate::utils::buffd::MsgParserError; use crate::utils::clonecell::CloneCell; use crate::utils::copyhashmap::CopyHashMap; -use crate::utils::linkedlist::LinkedList; +use crate::utils::linkedlist::{LinkedList, LinkedNode}; use crate::wire::wl_seat::*; use crate::wire::{ WlDataDeviceId, WlKeyboardId, WlPointerId, WlSeatId, ZwpPrimarySelectionDeviceV1Id, }; -use crate::xkbcommon::{XkbContext, XkbState}; -use crate::{NumCell, State}; +use crate::xkbcommon::{XkbKeymap, XkbState}; +use crate::{ErrorFmt, NumCell, State}; use ahash::{AHashMap, AHashSet}; -use bstr::ByteSlice; pub use event_handling::NodeSeatState; +use i4config::keyboard::mods::Modifiers; use std::cell::{Cell, RefCell}; use std::collections::hash_map::Entry; -use std::io::Write; use std::mem; use std::ops::DerefMut; use std::rc::Rc; use thiserror::Error; -use uapi::{c, OwnedFd}; +use uapi::{c, Errno, OwnedFd}; +use i4config::Direction; +use crate::async_engine::SpawnedFuture; const POINTER: u32 = 1; const KEYBOARD: u32 = 2; @@ -79,11 +79,13 @@ impl Drop for DroppedDnd { } } +linear_ids!(SeatIds, SeatId); + pub struct WlSeatGlobal { + id: SeatId, name: GlobalName, state: Rc, - seat: Rc, - seat_name: Rc, + seat_name: String, move_: Cell, move_start_pos: Cell<(Fixed, Fixed)>, extents_start_pos: Cell<(i32, i32)>, @@ -101,9 +103,9 @@ pub struct WlSeatGlobal { AHashMap>, >, >, + repeat_rate: Cell<(i32, i32)>, + kb_map: CloneCell>, kb_state: RefCell, - layout: Rc, - layout_size: u32, cursor: CloneCell>>, serial: NumCell, tree_changed: Rc, @@ -111,37 +113,22 @@ pub struct WlSeatGlobal { primary_selection: CloneCell>>, pointer_owner: PointerOwnerHolder, dropped_dnd: RefCell>, + shortcuts: CopyHashMap<(u32, u32), Modifiers>, + queue_link: Cell>>>, + tree_changed_handler: Cell>>, } impl WlSeatGlobal { pub fn new( name: GlobalName, + seat_name: &str, state: &Rc, - seat: &Rc, - tree_changed: &Rc, - ) -> Self { - let (kb_state, layout, layout_size) = { - let ctx = XkbContext::new().unwrap(); - let keymap = ctx.default_keymap().unwrap(); - let state = keymap.state().unwrap(); - let string = keymap.as_str().unwrap(); - let mut memfd = - uapi::memfd_create("keymap", c::MFD_CLOEXEC | c::MFD_ALLOW_SEALING).unwrap(); - memfd.write_all(string.as_bytes()).unwrap(); - memfd.write_all(&[0]).unwrap(); - uapi::lseek(memfd.raw(), 0, c::SEEK_SET).unwrap(); - uapi::fcntl_add_seals( - memfd.raw(), - c::F_SEAL_SEAL | c::F_SEAL_GROW | c::F_SEAL_SHRINK | c::F_SEAL_WRITE, - ) - .unwrap(); - (state, Rc::new(memfd), (string.len() + 1) as _) - }; - Self { + ) -> Rc { + let slf = Rc::new(Self { + id: state.seat_ids.next(), name, state: state.clone(), - seat: seat.clone(), - seat_name: Rc::new(format!("seat-{}", seat.id())), + seat_name: seat_name.to_string(), move_: Cell::new(false), move_start_pos: Cell::new((Fixed(0), Fixed(0))), extents_start_pos: Cell::new((0, 0)), @@ -154,19 +141,79 @@ impl WlSeatGlobal { bindings: Default::default(), data_devices: RefCell::new(Default::default()), primary_selection_devices: RefCell::new(Default::default()), - kb_state: RefCell::new(kb_state), - layout, - layout_size, + repeat_rate: Cell::new((25, 250)), + kb_map: CloneCell::new(state.default_keymap.clone()), + kb_state: RefCell::new(state.default_keymap.state().unwrap()), cursor: Default::default(), serial: Default::default(), - tree_changed: tree_changed.clone(), + tree_changed: Default::default(), selection: Default::default(), primary_selection: Default::default(), pointer_owner: Default::default(), dropped_dnd: RefCell::new(None), + shortcuts: Default::default(), + queue_link: Cell::new(None), + tree_changed_handler: Cell::new(None), + }); + let seat = slf.clone(); + state.eng.spawn(async move { + loop { + seat.tree_changed.triggered().await; + seat.state.tree_changed_sent.set(false); + seat.tree_changed(); + } + }); + slf + } + + pub fn mark_last_active(self: &Rc) { + self.queue_link.set(Some(self.state.seat_queue.add_last(self.clone()))); + } + + pub fn set_keymap(&self, keymap: &Rc) { + self.kb_map.set(keymap.clone()); + let bindings = self.bindings.borrow_mut(); + for (id, client) in bindings.iter() { + for seat in client.values() { + let kbs = seat.keyboards.lock(); + for kb in kbs.values() { + let fd = match seat.keymap_fd(&keymap) { + Ok(fd) => fd, + Err(e) => { + log::error!("Could not creat a file descriptor to transfer the keymap to client {}: {}", id, ErrorFmt(e)); + continue; + } + }; + kb.send_keymap(wl_keyboard::XKB_V1, fd, keymap.map_len as _); + } + } } } + pub fn get_rate(&self) -> (i32, i32) { + self.repeat_rate.get() + } + + pub fn set_rate(&self, rate: i32, delay: i32) { + self.repeat_rate.set((rate, delay)); + let bindings = self.bindings.borrow_mut(); + for client in bindings.values() { + for seat in client.values() { + if seat.version >= REPEAT_INFO_SINCE { + let kbs = seat.keyboards.lock(); + for kb in kbs.values() { + kb.send_repeat_info(rate, delay); + } + } + } + } + } + + pub fn move_focus(self: &Rc, direction: Direction) { + let kb_node = self.keyboard_node.get(); + kb_node.move_focus(self, direction); + } + fn set_selection_( self: &Rc, field: &CloneCell>>, @@ -275,7 +322,7 @@ impl WlSeatGlobal { } pub fn id(&self) -> SeatId { - self.seat.id() + self.id } fn bind_( @@ -321,6 +368,8 @@ impl Global for WlSeatGlobal { fn break_loops(&self) { self.bindings.borrow_mut().clear(); + self.queue_link.take(); + self.tree_changed_handler.take(); } } @@ -336,6 +385,8 @@ pub struct WlSeat { tracker: Tracker, } +const READ_ONLY_KEYMAP_SINCE: u32 = 7; + impl WlSeat { fn send_capabilities(self: &Rc) { self.client.event(Capabilities { @@ -404,13 +455,41 @@ impl WlSeat { track!(self.client, p); self.client.add_client_obj(&p)?; self.keyboards.set(req.id, p.clone()); - p.send_keymap(wl_keyboard::XKB_V1, p.keymap_fd()?, self.global.layout_size); + let keymap = self.global.kb_map.get(); + p.send_keymap(wl_keyboard::XKB_V1, self.keymap_fd(&keymap)?, keymap.map_len as _); if self.version >= REPEAT_INFO_SINCE { - p.send_repeat_info(25, 250); + let (rate, delay) = self.global.repeat_rate.get(); + p.send_repeat_info(rate, delay); } Ok(()) } + pub fn keymap_fd(&self, keymap: &XkbKeymap) -> Result, WlKeyboardError> { + if self.version >= READ_ONLY_KEYMAP_SINCE { + return Ok(keymap.map.clone()); + } + let fd = match uapi::memfd_create("shared-keymap", c::MFD_CLOEXEC) { + Ok(fd) => fd, + Err(e) => return Err(WlKeyboardError::KeymapMemfd(e.into())), + }; + let target = keymap.map_len as c::off_t; + let mut pos = 0; + while pos < target { + let rem = target - pos; + let res = uapi::sendfile( + fd.raw(), + keymap.map.raw(), + Some(&mut pos), + rem as usize, + ); + match res { + Ok(_) | Err(Errno(c::EINTR)) => {} + Err(e) => return Err(WlKeyboardError::KeymapCopy(e.into())), + } + } + Ok(Rc::new(fd)) + } + fn get_touch(self: &Rc, parser: MsgParser<'_, '_>) -> Result<(), GetTouchError> { let req: GetTouch = self.client.parse(&**self, parser)?; let p = Rc::new(WlTouch::new(req.id, self)); diff --git a/src/ifs/wl_seat/event_handling.rs b/src/ifs/wl_seat/event_handling.rs index 870f0330..02ba077c 100644 --- a/src/ifs/wl_seat/event_handling.rs +++ b/src/ifs/wl_seat/event_handling.rs @@ -1,4 +1,4 @@ -use crate::backend::{KeyState, OutputId, ScrollAxis, SeatEvent, SeatId}; +use crate::backend::{KeyboardEvent, KeyState, MouseEvent, OutputId, ScrollAxis}; use crate::client::{Client, ClientId}; use crate::fixed::Fixed; use crate::ifs::ipc; @@ -6,7 +6,7 @@ use crate::ifs::ipc::wl_data_device::WlDataDevice; use crate::ifs::ipc::zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1; use crate::ifs::wl_seat::wl_keyboard::WlKeyboard; use crate::ifs::wl_seat::wl_pointer::{WlPointer, POINTER_FRAME_SINCE_VERSION}; -use crate::ifs::wl_seat::{wl_keyboard, wl_pointer, Dnd, WlSeat, WlSeatGlobal}; +use crate::ifs::wl_seat::{wl_keyboard, wl_pointer, Dnd, WlSeat, WlSeatGlobal, SeatId}; use crate::ifs::wl_surface::xdg_surface::xdg_popup::XdgPopup; use crate::ifs::wl_surface::xdg_surface::xdg_toplevel::XdgToplevel; use crate::ifs::wl_surface::xdg_surface::XdgSurface; @@ -17,6 +17,10 @@ use crate::utils::clonecell::CloneCell; use crate::utils::smallmap::SmallMap; use crate::wire::WlDataOfferId; use crate::xkbcommon::{ModifierState, XKB_KEY_DOWN, XKB_KEY_UP}; +use i4config::keyboard::mods::Modifiers; +use i4config::keyboard::syms::KeySym; +use i4config::keyboard::ModifiedKeySym; +use smallvec::SmallVec; use std::ops::Deref; use std::rc::Rc; @@ -30,37 +34,37 @@ pub struct NodeSeatState { impl NodeSeatState { pub(super) fn enter(&self, seat: &Rc) { - self.pointer_foci.insert(seat.seat.id(), seat.clone()); + self.pointer_foci.insert(seat.id, seat.clone()); } pub(super) fn leave(&self, seat: &WlSeatGlobal) { - self.pointer_foci.remove(&seat.seat.id()); + self.pointer_foci.remove(&seat.id); } pub(super) fn focus(&self, seat: &Rc) -> bool { - self.kb_foci.insert(seat.seat.id(), seat.clone()); + self.kb_foci.insert(seat.id, seat.clone()); self.kb_foci.len() == 1 } pub(super) fn unfocus(&self, seat: &WlSeatGlobal) -> bool { - self.kb_foci.remove(&seat.seat.id()); + self.kb_foci.remove(&seat.id); self.kb_foci.len() == 0 } pub(super) fn add_pointer_grab(&self, seat: &Rc) { - self.grabs.insert(seat.id(), seat.clone()); + self.grabs.insert(seat.id, seat.clone()); } pub(super) fn remove_pointer_grab(&self, seat: &WlSeatGlobal) { - self.grabs.remove(&seat.id()); + self.grabs.remove(&seat.id); } pub(super) fn add_dnd_target(&self, seat: &Rc) { - self.dnd_targets.insert(seat.id(), seat.clone()); + self.dnd_targets.insert(seat.id, seat.clone()); } pub(super) fn remove_dnd_target(&self, seat: &WlSeatGlobal) { - self.dnd_targets.remove(&seat.id()); + self.dnd_targets.remove(&seat.id); } // pub fn remove_pointer_grabs(&self) { @@ -100,13 +104,18 @@ impl NodeSeatState { } impl WlSeatGlobal { - pub fn event(self: &Rc, event: SeatEvent) { + pub fn kb_event(self: &Rc, event: KeyboardEvent) { match event { - SeatEvent::OutputPosition(o, x, y) => self.output_position_event(o, x, y), - SeatEvent::Motion(dx, dy) => self.motion_event(dx, dy), - SeatEvent::Button(b, s) => self.pointer_owner.button(self, b, s), - SeatEvent::Scroll(d, a) => self.pointer_owner.scroll(self, d, a), - SeatEvent::Key(k, s) => self.key_event(k, s), + KeyboardEvent::Key(k, s) => self.key_event(k, s), + } + } + + pub fn mouse_event(self: &Rc, event: MouseEvent) { + match event { + MouseEvent::OutputPosition(o, x, y) => self.output_position_event(o, x, y), + MouseEvent::Motion(dx, dy) => self.motion_event(dx, dy), + MouseEvent::Button(b, s) => self.pointer_owner.button(self, b, s), + MouseEvent::Scroll(d, a) => self.pointer_owner.scroll(self, d, a), } } @@ -143,9 +152,35 @@ impl WlSeatGlobal { } } }; - let mods = self.kb_state.borrow_mut().update(key, xkb_dir); + let mut shortcuts = SmallVec::<[_; 1]>::new(); + let new_mods; + { + let mut kb_state = self.kb_state.borrow_mut(); + if state == wl_keyboard::PRESSED { + let old_mods = kb_state.mods(); + let keysyms = kb_state.unmodified_keysyms(key); + for &sym in keysyms { + if let Some(mods) = self.shortcuts.get(&(old_mods.mods_effective, sym)) { + shortcuts.push(ModifiedKeySym { + mods, + sym: KeySym(sym), + }); + } + } + } + new_mods = kb_state.update(key, xkb_dir); + } let node = self.keyboard_node.get(); - node.key(self, key, state, mods); + if shortcuts.is_empty() { + node.key(self, key, state); + } else if let Some(config) = self.state.config.get() { + for shortcut in shortcuts { + config.invoke_shortcut(self.id(), &shortcut); + } + } + if let Some(mods) = new_mods { + node.mods(self, mods); + } } } @@ -206,6 +241,7 @@ impl WlSeatGlobal { mods_latched, mods_locked, group, + .. } = self.kb_state.borrow().mods(); let serial = self.serial.fetch_add(1); self.surface_kb_event(0, &surface, |k| { @@ -331,7 +367,15 @@ impl WlSeatGlobal { self.handle_new_position(true); } - pub fn tree_changed(self: &Rc) { + pub fn add_shortcut(&self, mods: Modifiers, keysym: KeySym) { + self.shortcuts.set((mods.0, keysym.0), mods); + } + + pub fn trigger_tree_changed(&self) { + self.tree_changed.trigger(); + } + + pub(super) fn tree_changed(self: &Rc) { self.handle_new_position(false); } @@ -417,27 +461,25 @@ impl WlSeatGlobal { // Key callbacks impl WlSeatGlobal { - pub fn key_surface( - &self, - surface: &WlSurface, - key: u32, - state: u32, - mods: Option, - ) { + pub fn key_surface(&self, surface: &WlSurface, key: u32, state: u32) { let serial = self.serial.fetch_add(1); self.surface_kb_event(0, surface, |k| k.send_key(serial, 0, key, state)); + } +} + +// Modifiers callbacks +impl WlSeatGlobal { + pub fn mods_surface(&self, surface: &WlSurface, mods: ModifierState) { let serial = self.serial.fetch_add(1); - if let Some(mods) = mods { - self.surface_kb_event(0, surface, |k| { - k.send_modifiers( - serial, - mods.mods_depressed, - mods.mods_latched, - mods.mods_locked, - mods.group, - ) - }); - } + self.surface_kb_event(0, surface, |k| { + k.send_modifiers( + serial, + mods.mods_depressed, + mods.mods_latched, + mods.mods_locked, + mods.group, + ) + }); } } diff --git a/src/ifs/wl_seat/wl_keyboard.rs b/src/ifs/wl_seat/wl_keyboard.rs index f878fc45..9dbdfff2 100644 --- a/src/ifs/wl_seat/wl_keyboard.rs +++ b/src/ifs/wl_seat/wl_keyboard.rs @@ -8,7 +8,7 @@ use crate::wire::wl_keyboard::*; use crate::wire::{WlKeyboardId, WlSurfaceId}; use std::rc::Rc; use thiserror::Error; -use uapi::{c, Errno, OwnedFd}; +use uapi::{OwnedFd}; pub const REPEAT_INFO_SINCE: u32 = 4; @@ -34,36 +34,6 @@ impl WlKeyboard { } } - pub fn needs_dedicated_keymap_fd(&self) -> bool { - self.seat.version < 7 - } - - pub fn keymap_fd(&self) -> Result, WlKeyboardError> { - if !self.needs_dedicated_keymap_fd() { - return Ok(self.seat.global.layout.clone()); - } - let fd = match uapi::memfd_create("shared-keymap", c::MFD_CLOEXEC) { - Ok(fd) => fd, - Err(e) => return Err(WlKeyboardError::KeymapMemfd(e.into())), - }; - let target = self.seat.global.layout_size as c::off_t; - let mut pos = 0; - while pos < target { - let rem = target - pos; - let res = uapi::sendfile( - fd.raw(), - self.seat.global.layout.raw(), - Some(&mut pos), - rem as usize, - ); - match res { - Ok(_) | Err(Errno(c::EINTR)) => {} - Err(e) => return Err(WlKeyboardError::KeymapCopy(e.into())), - } - } - Ok(Rc::new(fd)) - } - pub fn send_keymap(self: &Rc, format: u32, fd: Rc, size: u32) { self.seat.client.event(Keymap { self_id: self.id, diff --git a/src/ifs/wl_surface.rs b/src/ifs/wl_surface.rs index bafe9312..f554df4c 100644 --- a/src/ifs/wl_surface.rs +++ b/src/ifs/wl_surface.rs @@ -2,12 +2,11 @@ pub mod cursor; pub mod wl_subsurface; pub mod xdg_surface; -use crate::backend::{KeyState, ScrollAxis, SeatId}; use crate::client::{Client, ClientError, RequestParser}; use crate::fixed::Fixed; use crate::ifs::wl_buffer::WlBuffer; use crate::ifs::wl_callback::WlCallback; -use crate::ifs::wl_seat::{Dnd, NodeSeatState, WlSeatGlobal}; +use crate::ifs::wl_seat::{Dnd, NodeSeatState, SeatId, WlSeatGlobal}; use crate::ifs::wl_surface::cursor::CursorSurface; use crate::ifs::wl_surface::wl_subsurface::WlSubsurface; use crate::ifs::wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceRole}; @@ -32,6 +31,8 @@ use std::mem; use std::ops::{Deref, DerefMut}; use std::rc::Rc; use thiserror::Error; +use i4config::Direction; +use crate::backend::{KeyState, ScrollAxis}; #[allow(dead_code)] const INVALID_SCALE: u32 = 0; @@ -609,6 +610,14 @@ impl Node for WlSurface { self.seat_state.destroy_node(self); } + fn move_focus(&self, seat: &Rc, direction: Direction) { + let xdg = match self.xdg.get() { + Some(x) => x, + _ => return, + }; + xdg.move_focus(seat, direction); + } + fn absolute_position(&self) -> Rect { self.buffer_abs_pos.get() } @@ -619,8 +628,12 @@ impl Node for WlSurface { } } - fn key(&self, seat: &WlSeatGlobal, key: u32, state: u32, mods: Option) { - seat.key_surface(self, key, state, mods); + fn key(&self, seat: &WlSeatGlobal, key: u32, state: u32) { + seat.key_surface(self, key, state); + } + + fn mods(&self, seat: &WlSeatGlobal, mods: ModifierState) { + seat.mods_surface(self, mods); } fn button(self: Rc, seat: &Rc, button: u32, state: KeyState) { @@ -665,10 +678,6 @@ impl Node for WlSurface { Some(self) } - fn dnd_enter(&self, dnd: &Dnd, x: Fixed, y: Fixed) { - dnd.seat.dnd_surface_enter(self, dnd, x, y); - } - fn dnd_drop(&self, dnd: &Dnd) { dnd.seat.dnd_surface_drop(self, dnd); } @@ -677,6 +686,10 @@ impl Node for WlSurface { dnd.seat.dnd_surface_leave(self, dnd); } + fn dnd_enter(&self, dnd: &Dnd, x: Fixed, y: Fixed) { + dnd.seat.dnd_surface_enter(self, dnd, x, y); + } + fn dnd_motion(&self, dnd: &Dnd, x: Fixed, y: Fixed) { dnd.seat.dnd_surface_motion(self, dnd, x, y); } diff --git a/src/ifs/wl_surface/xdg_surface.rs b/src/ifs/wl_surface/xdg_surface.rs index 06b10afe..8ea351c8 100644 --- a/src/ifs/wl_surface/xdg_surface.rs +++ b/src/ifs/wl_surface/xdg_surface.rs @@ -1,9 +1,8 @@ pub mod xdg_popup; pub mod xdg_toplevel; -use crate::backend::SeatId; use crate::client::ClientError; -use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal}; +use crate::ifs::wl_seat::{NodeSeatState, SeatId, WlSeatGlobal}; use crate::ifs::wl_surface::xdg_surface::xdg_popup::{XdgPopup, XdgPopupError}; use crate::ifs::wl_surface::xdg_surface::xdg_toplevel::XdgToplevel; use crate::ifs::wl_surface::{ @@ -26,6 +25,7 @@ use std::cell::Cell; use std::fmt::Debug; use std::rc::Rc; use thiserror::Error; +use i4config::Direction; #[allow(dead_code)] const NOT_CONSTRUCTED: u32 = 1; @@ -75,6 +75,11 @@ struct PendingXdgSurfaceData { } pub trait XdgSurfaceExt: Debug { + fn move_focus(self: Rc, seat: &Rc, direction: Direction) { + let _ = seat; + let _ = direction; + } + fn initial_configure(self: Rc) -> Result<(), XdgSurfaceError> { Ok(()) } @@ -137,6 +142,14 @@ impl XdgSurface { } } + pub fn move_focus(&self, seat: &Rc, direction: Direction) { + let ext = match self.ext.get() { + None => return, + Some(e) => e, + }; + ext.move_focus(seat, direction); + } + pub fn role(&self) -> XdgSurfaceRole { self.role.get() } diff --git a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs index b6a4066e..54ea951f 100644 --- a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs +++ b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs @@ -1,9 +1,8 @@ -use crate::backend::SeatId; use crate::bugs::Bugs; use crate::client::{Client, ClientError}; use crate::cursor::KnownCursor; use crate::fixed::Fixed; -use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal}; +use crate::ifs::wl_seat::{NodeSeatState, SeatId, WlSeatGlobal}; use crate::ifs::wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceExt}; use crate::leaks::Tracker; use crate::object::Object; @@ -27,6 +26,7 @@ use std::mem; use std::ops::Deref; use std::rc::Rc; use thiserror::Error; +use i4config::Direction; #[derive(Copy, Clone, Debug, FromPrimitive)] pub enum ResizeEdge { @@ -438,6 +438,10 @@ impl Node for XdgToplevel { self.xdg.seat_state.destroy_node(self) } + fn do_focus(self: Rc, seat: &Rc, _direction: Direction) { + seat.focus_toplevel(&self); + } + fn absolute_position(&self) -> Rect { self.xdg.absolute_desired_extents.get() } @@ -480,6 +484,14 @@ impl Node for XdgToplevel { } impl XdgSurfaceExt for XdgToplevel { + fn move_focus(self: Rc, seat: &Rc, direction: Direction) { + let pn = match self.parent_node.get() { + Some(pn) => pn, + _ => return, + }; + pn.move_focus_from_child(seat, &*self, direction); + } + fn initial_configure(self: Rc) -> Result<(), XdgSurfaceError> { self.send_configure(0, 0); Ok(()) diff --git a/src/keycodes.xkb b/src/keycodes.xkb new file mode 100644 index 00000000..78986b54 --- /dev/null +++ b/src/keycodes.xkb @@ -0,0 +1,485 @@ + <1> = 9; # ESC + <2> = 10; # 1 + <3> = 11; # 2 + <4> = 12; # 3 + <5> = 13; # 4 + <6> = 14; # 5 + <7> = 15; # 6 + <8> = 16; # 7 + <9> = 17; # 8 + <10> = 18; # 9 + <11> = 19; # 0 + <12> = 20; # MINUS + <13> = 21; # EQUAL + <14> = 22; # BACKSPACE + <15> = 23; # TAB + <16> = 24; # Q + <17> = 25; # W + <18> = 26; # E + <19> = 27; # R + <20> = 28; # T + <21> = 29; # Y + <22> = 30; # U + <23> = 31; # I + <24> = 32; # O + <25> = 33; # P + <26> = 34; # LEFTBRACE + <27> = 35; # RIGHTBRACE + <28> = 36; # ENTER + <29> = 37; # LEFTCTRL + <30> = 38; # A + <31> = 39; # S + <32> = 40; # D + <33> = 41; # F + <34> = 42; # G + <35> = 43; # H + <36> = 44; # J + <37> = 45; # K + <38> = 46; # L + <39> = 47; # SEMICOLON + <40> = 48; # APOSTROPHE + <41> = 49; # GRAVE + <42> = 50; # LEFTSHIFT + <43> = 51; # BACKSLASH + <44> = 52; # Z + <45> = 53; # X + <46> = 54; # C + <47> = 55; # V + <48> = 56; # B + <49> = 57; # N + <50> = 58; # M + <51> = 59; # COMMA + <52> = 60; # DOT + <53> = 61; # SLASH + <54> = 62; # RIGHTSHIFT + <55> = 63; # KPASTERISK + <56> = 64; # LEFTALT + <57> = 65; # SPACE + <58> = 66; # CAPSLOCK + <59> = 67; # F1 + <60> = 68; # F2 + <61> = 69; # F3 + <62> = 70; # F4 + <63> = 71; # F5 + <64> = 72; # F6 + <65> = 73; # F7 + <66> = 74; # F8 + <67> = 75; # F9 + <68> = 76; # F10 + <69> = 77; # NUMLOCK + <70> = 78; # SCROLLLOCK + <71> = 79; # KP7 + <72> = 80; # KP8 + <73> = 81; # KP9 + <74> = 82; # KPMINUS + <75> = 83; # KP4 + <76> = 84; # KP5 + <77> = 85; # KP6 + <78> = 86; # KPPLUS + <79> = 87; # KP1 + <80> = 88; # KP2 + <81> = 89; # KP3 + <82> = 90; # KP0 + <83> = 91; # KPDOT + <85> = 93; # ZENKAKUHANKAKU + <86> = 94; # 102ND + <87> = 95; # F11 + <88> = 96; # F12 + <89> = 97; # RO + <90> = 98; # KATAKANA + <91> = 99; # HIRAGANA + <92> = 100; # HENKAN + <93> = 101; # KATAKANAHIRAGANA + <94> = 102; # MUHENKAN + <95> = 103; # KPJPCOMMA + <96> = 104; # KPENTER + <97> = 105; # RIGHTCTRL + <98> = 106; # KPSLASH + <99> = 107; # SYSRQ +<100> = 108; # RIGHTALT +<101> = 109; # LINEFEED +<102> = 110; # HOME +<103> = 111; # UP +<104> = 112; # PAGEUP +<105> = 113; # LEFT +<106> = 114; # RIGHT +<107> = 115; # END +<108> = 116; # DOWN +<109> = 117; # PAGEDOWN +<110> = 118; # INSERT +111> = 119; # DELETE +<112> = 120; # MACRO +<113> = 121; # MUTE +<114> = 122; # VOLUMEDOWN +<115> = 123; # VOLUMEUP +<116> = 124; # POWER +<117> = 125; # KPEQUAL +<118> = 126; # KPPLUSMINUS +<119> = 127; # PAUSE +<120> = 128; # SCALE +<121> = 129; # KPCOMMA +<122> = 130; # HANGEUL +<123> = 131; # HANJA +<124> = 132; # YEN +<125> = 133; # LEFTMETA +<126> = 134; # RIGHTMETA +<127> = 135; # COMPOSE +<128> = 136; # STOP +<129> = 137; # AGAIN +<130> = 138; # PROPS +<131> = 139; # UNDO +<132> = 140; # FRONT +<133> = 141; # COPY +<134> = 142; # OPEN +<135> = 143; # PASTE +<136> = 144; # FIND +<137> = 145; # CUT +<138> = 146; # HELP +<139> = 147; # MENU +<140> = 148; # CALC +<141> = 149; # SETUP +<142> = 150; # SLEEP +<143> = 151; # WAKEUP +<144> = 152; # FILE +<145> = 153; # SENDFILE +<146> = 154; # DELETEFILE +<147> = 155; # XFER +<148> = 156; # PROG1 +<149> = 157; # PROG2 +<150> = 158; # WWW +<151> = 159; # MSDOS +<152> = 160; # COFFEE +<153> = 161; # ROTATE_DISPLAY +<154> = 162; # CYCLEWINDOWS +<155> = 163; # MAIL +<156> = 164; # BOOKMARKS +<157> = 165; # COMPUTER +<158> = 166; # BACK +<159> = 167; # FORWARD +<160> = 168; # CLOSECD +<161> = 169; # EJECTCD +<162> = 170; # EJECTCLOSECD +<163> = 171; # NEXTSONG +<164> = 172; # PLAYPAUSE +<165> = 173; # PREVIOUSSONG +<166> = 174; # STOPCD +<167> = 175; # RECORD +<168> = 176; # REWIND +<169> = 177; # PHONE +<170> = 178; # ISO +<171> = 179; # CONFIG +<172> = 180; # HOMEPAGE +<173> = 181; # REFRESH +<174> = 182; # EXIT +<175> = 183; # MOVE +<176> = 184; # EDIT +<177> = 185; # SCROLLUP +<178> = 186; # SCROLLDOWN +<179> = 187; # KPLEFTPAREN +<180> = 188; # KPRIGHTPAREN +<181> = 189; # NEW +<182> = 190; # REDO +<183> = 191; # F13 +<184> = 192; # F14 +<185> = 193; # F15 +<186> = 194; # F16 +<187> = 195; # F17 +<188> = 196; # F18 +<189> = 197; # F19 +<190> = 198; # F20 +<191> = 199; # F21 +<192> = 200; # F22 +<193> = 201; # F23 +<194> = 202; # F24 +<200> = 208; # PLAYCD +<201> = 209; # PAUSECD +<202> = 210; # PROG3 +<203> = 211; # PROG4 +<204> = 212; # DASHBOARD +<205> = 213; # SUSPEND +<206> = 214; # CLOSE +<207> = 215; # PLAY +<208> = 216; # FASTFORWARD +<209> = 217; # BASSBOOST +<210> = 218; # PRINT +<211> = 219; # HP +<212> = 220; # CAMERA +<213> = 221; # SOUND +<214> = 222; # QUESTION +<215> = 223; # EMAIL +<216> = 224; # CHAT +<217> = 225; # SEARCH +<218> = 226; # CONNECT +<219> = 227; # FINANCE +<220> = 228; # SPORT +<221> = 229; # SHOP +<222> = 230; # ALTERASE +<223> = 231; # CANCEL +<224> = 232; # BRIGHTNESSDOWN +<225> = 233; # BRIGHTNESSUP +<226> = 234; # MEDIA +<227> = 235; # SWITCHVIDEOMODE +<228> = 236; # KBDILLUMTOGGLE +<229> = 237; # KBDILLUMDOWN +<230> = 238; # KBDILLUMUP +<231> = 239; # SEND +<232> = 240; # REPLY +<233> = 241; # FORWARDMAIL +<234> = 242; # SAVE +<235> = 243; # DOCUMENTS +<236> = 244; # BATTERY +<237> = 245; # BLUETOOTH +<238> = 246; # WLAN +<239> = 247; # UWB +<240> = 248; # UNKNOWN +<241> = 249; # VIDEO_NEXT +<242> = 250; # VIDEO_PREV +<243> = 251; # BRIGHTNESS_CYCLE +<244> = 252; # BRIGHTNESS_AUTO +<245> = 253; # DISPLAY_OFF +<246> = 254; # WWAN +<247> = 255; # RFKILL +<248> = 256; # MICMUTE +<352> = 360; # OK +<353> = 361; # SELECT +<354> = 362; # GOTO +<355> = 363; # CLEAR +<356> = 364; # POWER2 +<357> = 365; # OPTION +<358> = 366; # INFO +<359> = 367; # TIME +<360> = 368; # VENDOR +<361> = 369; # ARCHIVE +<362> = 370; # PROGRAM +<363> = 371; # CHANNEL +<364> = 372; # FAVORITES +<365> = 373; # EPG +<366> = 374; # PVR +<367> = 375; # MHP +<368> = 376; # LANGUAGE +<369> = 377; # TITLE +<370> = 378; # SUBTITLE +<371> = 379; # ANGLE +<372> = 380; # FULL_SCREEN +<373> = 381; # MODE +<374> = 382; # KEYBOARD +<375> = 383; # ASPECT_RATIO +<376> = 384; # PC +<377> = 385; # TV +<378> = 386; # TV2 +<379> = 387; # VCR +<380> = 388; # VCR2 +<381> = 389; # SAT +<382> = 390; # SAT2 +<383> = 391; # CD +<384> = 392; # TAPE +<385> = 393; # RADIO +<386> = 394; # TUNER +<387> = 395; # PLAYER +<388> = 396; # TEXT +<389> = 397; # DVD +<390> = 398; # AUX +<391> = 399; # MP3 +<392> = 400; # AUDIO +<393> = 401; # VIDEO +<394> = 402; # DIRECTORY +<395> = 403; # LIST +<396> = 404; # MEMO +<397> = 405; # CALENDAR +<398> = 406; # RED +<399> = 407; # GREEN +<400> = 408; # YELLOW +<401> = 409; # BLUE +<402> = 410; # CHANNELUP +<403> = 411; # CHANNELDOWN +<404> = 412; # FIRST +<405> = 413; # LAST +<406> = 414; # AB +<407> = 415; # NEXT +<408> = 416; # RESTART +<409> = 417; # SLOW +<410> = 418; # SHUFFLE +<411> = 419; # BREAK +<412> = 420; # PREVIOUS +<413> = 421; # DIGITS +<414> = 422; # TEEN +<415> = 423; # TWEN +<416> = 424; # VIDEOPHONE +<417> = 425; # GAMES +<418> = 426; # ZOOMIN +<419> = 427; # ZOOMOUT +<420> = 428; # ZOOMRESET +<421> = 429; # WORDPROCESSOR +<422> = 430; # EDITOR +<423> = 431; # SPREADSHEET +<424> = 432; # GRAPHICSEDITOR +<425> = 433; # PRESENTATION +<426> = 434; # DATABASE +<427> = 435; # NEWS +<428> = 436; # VOICEMAIL +<429> = 437; # ADDRESSBOOK +<430> = 438; # MESSENGER +<431> = 439; # DISPLAYTOGGLE +<432> = 440; # SPELLCHECK +<433> = 441; # LOGOFF +<434> = 442; # DOLLAR +<435> = 443; # EURO +<436> = 444; # FRAMEBACK +<437> = 445; # FRAMEFORWARD +<438> = 446; # CONTEXT_MENU +<439> = 447; # MEDIA_REPEAT +<440> = 448; # 10CHANNELSUP +<441> = 449; # 10CHANNELSDOWN +<442> = 450; # IMAGES +<444> = 452; # NOTIFICATION_CENTER +<445> = 453; # PICKUP_PHONE +<446> = 454; # HANGUP_PHONE +<448> = 456; # DEL_EOL +<449> = 457; # DEL_EOS +<450> = 458; # INS_LINE +<451> = 459; # DEL_LINE +<464> = 472; # FN +<465> = 473; # FN_ESC +<466> = 474; # FN_F1 +<467> = 475; # FN_F2 +<468> = 476; # FN_F3 +<469> = 477; # FN_F4 +<470> = 478; # FN_F5 +<471> = 479; # FN_F6 +<472> = 480; # FN_F7 +<473> = 481; # FN_F8 +<474> = 482; # FN_F9 +<475> = 483; # FN_F10 +<476> = 484; # FN_F11 +<477> = 485; # FN_F12 +<478> = 486; # FN_1 +<479> = 487; # FN_2 +<480> = 488; # FN_D +<481> = 489; # FN_E +<482> = 490; # FN_F +<483> = 491; # FN_S +<484> = 492; # FN_B +<485> = 493; # FN_RIGHT_SHIFT +<497> = 505; # BRL_DOT1 +<498> = 506; # BRL_DOT2 +<499> = 507; # BRL_DOT3 +<500> = 508; # BRL_DOT4 +<501> = 509; # BRL_DOT5 +<502> = 510; # BRL_DOT6 +<503> = 511; # BRL_DOT7 +<504> = 512; # BRL_DOT8 +<505> = 513; # BRL_DOT9 +<506> = 514; # BRL_DOT10 +<512> = 520; # NUMERIC_0 +<513> = 521; # NUMERIC_1 +<514> = 522; # NUMERIC_2 +<515> = 523; # NUMERIC_3 +<516> = 524; # NUMERIC_4 +<517> = 525; # NUMERIC_5 +<518> = 526; # NUMERIC_6 +<519> = 527; # NUMERIC_7 +<520> = 528; # NUMERIC_8 +<521> = 529; # NUMERIC_9 +<522> = 530; # NUMERIC_STAR +<523> = 531; # NUMERIC_POUND +<524> = 532; # NUMERIC_A +<525> = 533; # NUMERIC_B +<526> = 534; # NUMERIC_C +<527> = 535; # NUMERIC_D +<528> = 536; # CAMERA_FOCUS +<529> = 537; # WPS_BUTTON +<530> = 538; # TOUCHPAD_TOGGLE +<531> = 539; # TOUCHPAD_ON +<532> = 540; # TOUCHPAD_OFF +<533> = 541; # CAMERA_ZOOMIN +<534> = 542; # CAMERA_ZOOMOUT +<535> = 543; # CAMERA_UP +<536> = 544; # CAMERA_DOWN +<537> = 545; # CAMERA_LEFT +<538> = 546; # CAMERA_RIGHT +<539> = 547; # ATTENDANT_ON +<540> = 548; # ATTENDANT_OFF +<541> = 549; # ATTENDANT_TOGGLE +<542> = 550; # LIGHTS_TOGGLE +<560> = 568; # ALS_TOGGLE +<561> = 569; # ROTATE_LOCK_TOGGLE +<576> = 584; # BUTTONCONFIG +<577> = 585; # TASKMANAGER +<578> = 586; # JOURNAL +<579> = 587; # CONTROLPANEL +<580> = 588; # APPSELECT +<581> = 589; # SCREENSAVER +<582> = 590; # VOICECOMMAND +<583> = 591; # ASSISTANT +<584> = 592; # KBD_LAYOUT_NEXT +<585> = 593; # EMOJI_PICKER +<592> = 600; # BRIGHTNESS_MIN +<593> = 601; # BRIGHTNESS_MAX +<608> = 616; # KBDINPUTASSIST_PREV +<609> = 617; # KBDINPUTASSIST_NEXT +<610> = 618; # KBDINPUTASSIST_PREVGROUP +<611> = 619; # KBDINPUTASSIST_NEXTGROUP +<612> = 620; # KBDINPUTASSIST_ACCEPT +<613> = 621; # KBDINPUTASSIST_CANCEL +<614> = 622; # RIGHT_UP +<615> = 623; # RIGHT_DOWN +<616> = 624; # LEFT_UP +<617> = 625; # LEFT_DOWN +<618> = 626; # ROOT_MENU +<619> = 627; # MEDIA_TOP_MENU +<620> = 628; # NUMERIC_11 +<621> = 629; # NUMERIC_12 +<622> = 630; # AUDIO_DESC +<623> = 631; # 3D_MODE +<624> = 632; # NEXT_FAVORITE +<625> = 633; # STOP_RECORD +<626> = 634; # PAUSE_RECORD +<627> = 635; # VOD +<628> = 636; # UNMUTE +<629> = 637; # FASTREVERSE +<630> = 638; # SLOWREVERSE +<631> = 639; # DATA +<632> = 640; # ONSCREEN_KEYBOARD +<633> = 641; # PRIVACY_SCREEN_TOGGLE +<634> = 642; # SELECTIVE_SCREENSHOT +<656> = 664; # MACRO1 +<657> = 665; # MACRO2 +<658> = 666; # MACRO3 +<659> = 667; # MACRO4 +<660> = 668; # MACRO5 +<661> = 669; # MACRO6 +<662> = 670; # MACRO7 +<663> = 671; # MACRO8 +<664> = 672; # MACRO9 +<665> = 673; # MACRO10 +<666> = 674; # MACRO11 +<667> = 675; # MACRO12 +<668> = 676; # MACRO13 +<669> = 677; # MACRO14 +<670> = 678; # MACRO15 +<671> = 679; # MACRO16 +<672> = 680; # MACRO17 +<673> = 681; # MACRO18 +<674> = 682; # MACRO19 +<675> = 683; # MACRO20 +<676> = 684; # MACRO21 +<677> = 685; # MACRO22 +<678> = 686; # MACRO23 +<679> = 687; # MACRO24 +<680> = 688; # MACRO25 +<681> = 689; # MACRO26 +<682> = 690; # MACRO27 +<683> = 691; # MACRO28 +<684> = 692; # MACRO29 +<685> = 693; # MACRO30 +<688> = 696; # MACRO_RECORD_START +<689> = 697; # MACRO_RECORD_STOP +<690> = 698; # MACRO_PRESET_CYCLE +<691> = 699; # MACRO_PRESET1 +<692> = 700; # MACRO_PRESET2 +<693> = 701; # MACRO_PRESET3 +<696> = 704; # KBD_LCD_MENU1 +<697> = 705; # KBD_LCD_MENU2 +<698> = 706; # KBD_LCD_MENU3 +<699> = 707; # KBD_LCD_MENU4 +<700> = 708; # KBD_LCD_MENU5 diff --git a/src/keymap.xkb b/src/keymap.xkb new file mode 100644 index 00000000..456f22ae --- /dev/null +++ b/src/keymap.xkb @@ -0,0 +1,285 @@ +xkb_keymap { + + xkb_keycodes { + + <1> = 9; # ESC + <2> = 10; # 1 + <3> = 11; # 2 + <4> = 12; # 3 + <5> = 13; # 4 + <6> = 14; # 5 + <7> = 15; # 6 + <8> = 16; # 7 + <9> = 17; # 8 + <10> = 18; # 9 + <11> = 19; # 0 + <12> = 20; # MINUS + <13> = 21; # EQUAL + <14> = 22; # BACKSPACE + <15> = 23; # TAB + <16> = 24; # Q + <17> = 25; # W + <18> = 26; # E + <19> = 27; # R + <20> = 28; # T + <21> = 29; # Y + <22> = 30; # U + <23> = 31; # I + <24> = 32; # O + <25> = 33; # P + <26> = 34; # LEFTBRACE + <27> = 35; # RIGHTBRACE + <28> = 36; # ENTER + <29> = 37; # LEFTCTRL + <30> = 38; # A + <31> = 39; # S + <32> = 40; # D + <33> = 41; # F + <34> = 42; # G + <35> = 43; # H + <36> = 44; # J + <37> = 45; # K + <38> = 46; # L + <39> = 47; # SEMICOLON + <40> = 48; # APOSTROPHE + <41> = 49; # GRAVE + <42> = 50; # LEFTSHIFT + <43> = 51; # BACKSLASH + <44> = 52; # Z + <45> = 53; # X + <46> = 54; # C + <47> = 55; # V + <48> = 56; # B + <49> = 57; # N + <50> = 58; # M + <51> = 59; # COMMA + <52> = 60; # DOT + <53> = 61; # SLASH + <54> = 62; # RIGHTSHIFT + <55> = 63; # KPASTERISK + <56> = 64; # LEFTALT + <57> = 65; # SPACE + <58> = 66; # CAPSLOCK + <59> = 67; # F1 + <60> = 68; # F2 + <61> = 69; # F3 + <62> = 70; # F4 + <63> = 71; # F5 + <64> = 72; # F6 + <65> = 73; # F7 + <66> = 74; # F8 + <67> = 75; # F9 + <68> = 76; # F10 + <69> = 77; # NUMLOCK + <70> = 78; # SCROLLLOCK + <71> = 79; # KP7 + <72> = 80; # KP8 + <73> = 81; # KP9 + <74> = 82; # KPMINUS + <75> = 83; # KP4 + <76> = 84; # KP5 + <77> = 85; # KP6 + <78> = 86; # KPPLUS + <79> = 87; # KP1 + <80> = 88; # KP2 + <81> = 89; # KP3 + <82> = 90; # KP0 + <83> = 91; # KPDOT + <87> = 95; # F11 + <88> = 96; # F12 + <96> = 104; # KPENTER + <97> = 105; # RIGHTCTRL + <98> = 106; # KPSLASH + <100> = 108; # RIGHTALT + <102> = 110; # HOME + <103> = 111; # UP + <104> = 112; # PAGEUP + <105> = 113; # LEFT + <106> = 114; # RIGHT + <107> = 115; # END + <108> = 116; # DOWN + <109> = 117; # PAGEDOWN + <110> = 118; # INSERT + <111> = 119; # DELETE + <117> = 125; # KPEQUAL + <119> = 127; # PAUSE + <125> = 133; # LEFTMETA + <126> = 134; # RIGHTMETA + <139> = 147; # MENU + <210> = 218; # PRINT + + # We must include at least one indicator here. Otherwise Xwayland segfaults. + indicator 1 = "DUMMY"; + }; + + xkb_types { + + # We must include at least one virtual modifier. + # Otherwise Xwayland rejects our keymap. + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = none; + }; + type "TWO_LEVEL" { + modifiers = Shift; + map[Shift] = Level2; + }; + type "ALPHABETIC" { + modifiers = Shift+Lock; + map[Shift] = Level2; + map[Lock] = Level2; + }; + type "KEYPAD" { + modifiers = Shift+Mod2; + map[Mod2] = Level2; + }; + }; + + xkb_compatibility { + + interpret.repeat = False; + interpret.locking = False; + interpret Shift_L { + action = SetMods(modifiers=Shift); + }; + interpret Shift_R { + action = SetMods(modifiers=Shift); + }; + interpret Caps_Lock { + action = LockMods(modifiers=Lock); + }; + interpret Control_L { + action = SetMods(modifiers=Control); + }; + interpret Control_R { + action = SetMods(modifiers=Control); + }; + interpret Alt_L { + action = SetMods(modifiers=Mod1); + }; + interpret Alt_R { + action = SetMods(modifiers=Mod1); + }; + interpret Num_Lock { + action = LockMods(modifiers=Mod2); + }; + }; + + xkb_symbols { + + key <1> { [ Escape ] }; + key <59> { [ F1 ] }; + key <60> { [ F2 ] }; + key <61> { [ F3 ] }; + key <62> { [ F4 ] }; + key <63> { [ F5 ] }; + key <64> { [ F6 ] }; + key <65> { [ F7 ] }; + key <66> { [ F8 ] }; + key <67> { [ F9 ] }; + key <68> { [ F10 ] }; + key <87> { [ F11 ] }; + key <88> { [ F12 ] }; + key <210> { [ Print ] }; + key <70> { [ Scroll_Lock ] }; + key <119> { [ Pause ] }; + + key <69> { [ Num_Lock ] }; + key <96> { [ KP_Enter ] }; + key <98> { [ KP_Divide ] }; + key <74> { [ KP_Subtract ] }; + key <55> { [ KP_Multiply ] }; + key <78> { [ KP_Add ] }; + key <117> { [ KP_Equal ] }; + key <83> { [ KP_Delete, KP_Decimal ] }; + key <71> { [ KP_Home, KP_7 ] }; + key <72> { [ KP_Up, KP_8 ] }; + key <73> { [ KP_Prior, KP_9 ] }; + key <75> { [ KP_Left, KP_4 ] }; + key <76> { [ KP_Begin, KP_5 ] }; + key <77> { [ KP_Right, KP_6 ] }; + key <79> { [ KP_End, KP_1 ] }; + key <80> { [ KP_Down, KP_2 ] }; + key <81> { [ KP_Next, KP_3 ] }; + key <82> { [ KP_Insert, KP_0 ] }; + + key <103> { [ Up ] }; + key <105> { [ Left ] }; + key <106> { [ Right ] }; + key <108> { [ Down ] }; + + key <102> { [ Home ] }; + key <104> { [ Prior ] }; + key <107> { [ End ] }; + key <109> { [ Next ] }; + key <110> { [ Insert ] }; + key <111> { [ Delete ] }; + + key <14> { [ BackSpace ] }; + key <15> { [ Tab, ISO_Left_Tab ] }; + key <58> { [ Caps_Lock ] }; + key <28> { [ Return ] }; + key <42> { [ Shift_L ] }; + key <54> { [ Shift_R ] }; + key <29> { [ Control_L ] }; + key <125> { [ Super_L ] }; + key <56> { [ Alt_L ] }; + key <57> { [ space ] }; + key <100> { [ Alt_R ] }; + key <126> { [ Super_R ] }; + key <139> { [ Menu ] }; + key <97> { [ Control_R ] }; + + key <41> { [ grave, asciitilde ] }; + key <12> { [ minus, underscore ] }; + key <13> { [ equal, plus ] }; + key <26> { [ bracketleft, braceleft ] }; + key <27> { [ bracketright, braceright ] }; + key <43> { [ backslash, bar ] }; + key <39> { [ semicolon, colon ] }; + key <40> { [ apostrophe, quotedbl ] }; + key <51> { [ comma, less ] }; + key <52> { [ period, greater ] }; + key <53> { [ slash, question ] }; + + key <16> { [ q, Q ] }; + key <17> { [ w, W ] }; + key <18> { [ e, E ] }; + key <19> { [ r, R ] }; + key <20> { [ t, T ] }; + key <21> { [ y, Y ] }; + key <22> { [ u, U ] }; + key <23> { [ i, I ] }; + key <24> { [ o, O ] }; + key <25> { [ p, P ] }; + key <30> { [ a, A ] }; + key <31> { [ s, S ] }; + key <32> { [ d, D ] }; + key <33> { [ f, F ] }; + key <34> { [ g, G ] }; + key <35> { [ h, H ] }; + key <36> { [ j, J ] }; + key <37> { [ k, K ] }; + key <38> { [ l, L ] }; + key <44> { [ z, Z ] }; + key <45> { [ x, X ] }; + key <46> { [ c, C ] }; + key <47> { [ v, V ] }; + key <48> { [ b, B ] }; + key <49> { [ n, N ] }; + key <50> { [ m, M ] }; + + key <2> { [ 1, exclam ] }; + key <3> { [ 2, at ] }; + key <4> { [ 3, numbersign ] }; + key <5> { [ 4, dollar ] }; + key <6> { [ 5, percent ] }; + key <7> { [ 6, asciicircum ] }; + key <8> { [ 7, ampersand ] }; + key <9> { [ 8, asterisk ] }; + key <10> { [ 9, parenleft ] }; + key <11> { [ 0, parenright ] }; + }; + +}; diff --git a/src/leaks.rs b/src/leaks.rs index a6db2db5..d0ae4006 100644 --- a/src/leaks.rs +++ b/src/leaks.rs @@ -1,8 +1,14 @@ pub use leaks::*; +macro_rules! track { + ($client:expr, $rc:expr) => { + $rc.tracker.register($client.id); + }; +} + #[cfg(not(feature = "rc_tracking"))] -#[macro_use] mod leaks { + use crate::client::ClientId; use std::marker::PhantomData; pub fn init() { @@ -17,6 +23,12 @@ mod leaks { _phantom: PhantomData, } + impl Tracker { + pub fn register(&self, _client: ClientId) { + // nothing + } + } + impl Default for Tracker { fn default() -> Self { Self { @@ -24,16 +36,9 @@ mod leaks { } } } - - macro_rules! track { - ($client:expr, $rc:expr) => { - let _ = $rc.tracker; - } - } } #[cfg(feature = "rc_tracking")] -#[macro_use] mod leaks { use crate::client::ClientId; use crate::utils::ptr_ext::{MutPtrExt, PtrExt}; @@ -59,7 +64,12 @@ mod leaks { } } - fn log_containers(prefix: &str, allocation: &mut Allocation, offset: usize, logged: &mut AHashSet<*mut u8>) { + fn log_containers( + prefix: &str, + allocation: &mut Allocation, + offset: usize, + logged: &mut AHashSet<*mut u8>, + ) { log::info!( "{}Contained in allocation {:?} at offset {}. Backtrace:", prefix, @@ -94,6 +104,9 @@ mod leaks { for (id, obj) in MAP.deref_mut().drain() { map.entry(obj.client).or_default().push((id, obj)); } + if map.is_empty() { + log::info!("No leaks"); + } for (_, mut objs) in map.drain() { if objs.len() == 0 { continue; @@ -102,13 +115,11 @@ mod leaks { log::info!("Client {} leaked {} objects", objs[0].1.client, objs.len()); for (_, obj) in objs { let time = chrono::NaiveDateTime::from_timestamp(obj.time.0, obj.time.1); - log::info!( - " [{}] {}", - time.format("%H:%M:%S%.3f"), - obj.ty, - ); + log::info!(" [{}] {}", time.format("%H:%M:%S%.3f"), obj.ty,); match find_allocation_containing(obj.addr) { - Some(mut alloc) => log_containers(" ", &mut alloc, 0, &mut AHashSet::new()), + Some(mut alloc) => { + log_containers(" ", &mut alloc, 0, &mut AHashSet::new()) + } _ => log::error!(" Not contained in any allocation??"), } } @@ -174,14 +185,6 @@ mod leaks { } } - macro_rules! track { - ($client:expr, $rc:expr) => { - ($rc) - .tracker - .register($client.id); - }; - } - struct TracingAllocator; #[global_allocator] @@ -225,7 +228,7 @@ mod leaks { if INITIALIZED { ALLOCATIONS.deref_mut().remove(&ptr); } - c::memset(ptr as _, 0, layout.size()); + // c::memset(ptr as _, 0, layout.size()); c::free(ptr as _); } } diff --git a/src/macros.rs b/src/macros.rs index 14902476..5541bc80 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -168,6 +168,11 @@ macro_rules! linear_ids { pub fn raw(&self) -> u32 { self.0 } + + #[allow(dead_code)] + pub fn from_raw(id: u32) -> Self { + Self(id) + } } impl std::fmt::Display for $id { diff --git a/src/main.rs b/src/main.rs index 3a2b1d94..97a9487f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,4 @@ -#![feature( - c_variadic, - thread_local, - label_break_value, - ptr_metadata, - linkage, - const_type_name -)] +#![feature(c_variadic, thread_local, label_break_value)] #![allow( clippy::len_zero, clippy::needless_lifetimes, @@ -39,18 +32,18 @@ use crate::wheel::WheelError; use acceptor::Acceptor; use async_engine::AsyncEngine; use event_loop::EventLoop; -use isnt::std_1::primitive::IsntMutPtrExt; use log::LevelFilter; use std::cell::Cell; use std::ops::Deref; use std::rc::Rc; use thiserror::Error; use wheel::Wheel; +use crate::xkbcommon::XkbContext; #[macro_use] mod macros; #[macro_use] -pub mod leaks; +mod leaks; mod acceptor; mod async_engine; mod backend; @@ -58,6 +51,7 @@ mod backends; mod bugs; mod client; mod clientmem; +mod config; mod cursor; mod drm; mod event_loop; @@ -81,15 +75,6 @@ mod wire; mod xkbcommon; fn main() { - unsafe { - extern "C" { - #[linkage = "extern_weak"] - static BYTEHOUND_REACHED_MAIN: *mut bool; - } - if BYTEHOUND_REACHED_MAIN.is_not_null() { - *BYTEHOUND_REACHED_MAIN = true; - } - } env_logger::builder() .filter_level(LevelFilter::Info) .filter_level(LevelFilter::Debug) @@ -127,10 +112,14 @@ fn main_() -> Result<(), MainError> { clientmem::init()?; let el = EventLoop::new()?; sighand::install(&el)?; + let xkb_ctx = XkbContext::new().unwrap(); + let xkb_keymap = xkb_ctx.keymap_from_str(include_str!("keymap.xkb")).unwrap(); let wheel = Wheel::install(&el)?; let engine = AsyncEngine::install(&el, &wheel)?; let node_ids = NodeIds::default(); let state = Rc::new(State { + xkb_ctx, + default_keymap: xkb_keymap, eng: engine.clone(), el: el.clone(), render_ctx: Default::default(), @@ -144,14 +133,20 @@ fn main_() -> Result<(), MainError> { node_ids, backend_events: AsyncQueue::new(), output_handlers: Default::default(), + mouse_handlers: Default::default(), seat_ids: Default::default(), - seats: Default::default(), + kb_ids: Default::default(), outputs: Default::default(), seat_queue: Default::default(), slow_clients: AsyncQueue::new(), none_surface_ext: Rc::new(NoneSurfaceExt), tree_changed_sent: Cell::new(false), + config: Default::default(), + mouse_ids: Default::default(), + kb_handlers: Default::default(), }); + let config = config::ConfigProxy::default(&state); + state.config.set(Some(Rc::new(config))); let _global_event_handler = engine.spawn(tasks::handle_backend_events(state.clone())); let _slow_client_handler = engine.spawn(tasks::handle_slow_clients(state.clone())); Acceptor::install(&state)?; diff --git a/src/render/gl/program.rs b/src/render/gl/program.rs index 0e5a0d70..f49b0826 100644 --- a/src/render/gl/program.rs +++ b/src/render/gl/program.rs @@ -38,7 +38,7 @@ impl GlProgram { let mut ok = 0; glGetProgramiv(res.prog, GL_LINK_STATUS, &mut ok); - if ok == GL_FALSE as _ { + if ok == GL_FALSE as GLint { return Err(RenderError::ProgramLink); } diff --git a/src/render/gl/shader.rs b/src/render/gl/shader.rs index 7e4c8344..4dc294b6 100644 --- a/src/render/gl/shader.rs +++ b/src/render/gl/shader.rs @@ -3,6 +3,7 @@ use crate::render::gl::sys::{ glCompileShader, glCreateShader, glDeleteShader, glGetShaderiv, glShaderSource, GLenum, GLuint, GL_COMPILE_STATUS, GL_FALSE, }; +use crate::render::sys::GLint; use crate::render::RenderError; use std::rc::Rc; @@ -28,7 +29,7 @@ impl GlShader { let mut ok = 0; glGetShaderiv(shader, GL_COMPILE_STATUS, &mut ok); - if ok == GL_FALSE as _ { + if ok == GL_FALSE as GLint { return Err(RenderError::ShaderCompileFailed); } Ok(res) diff --git a/src/state.rs b/src/state.rs index f921ac11..1dc139f8 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,26 +1,29 @@ use crate::async_engine::{AsyncEngine, SpawnedFuture}; -use crate::backend::{BackendEvent, OutputId, OutputIds, SeatId, SeatIds}; +use crate::backend::{BackendEvent, KeyboardId, KeyboardIds, MouseId, MouseIds, OutputId, OutputIds}; use crate::client::{Client, Clients}; +use crate::config::ConfigProxy; use crate::cursor::ServerCursors; use crate::event_loop::EventLoop; use crate::globals::{Globals, GlobalsError, WaylandGlobal}; use crate::ifs::wl_output::WlOutputGlobal; -use crate::ifs::wl_seat::WlSeatGlobal; +use crate::ifs::wl_seat::{SeatIds, WlSeatGlobal}; use crate::ifs::wl_surface::NoneSurfaceExt; use crate::render::RenderContext; use crate::tree::{DisplayNode, NodeIds}; -use crate::utils::asyncevent::AsyncEvent; use crate::utils::clonecell::CloneCell; use crate::utils::copyhashmap::CopyHashMap; use crate::utils::linkedlist::LinkedList; use crate::utils::numcell::NumCell; use crate::utils::queue::AsyncQueue; -use crate::{ErrorFmt, Wheel}; +use crate::{ErrorFmt, Wheel, XkbContext}; use ahash::AHashMap; use std::cell::{Cell, RefCell}; use std::rc::Rc; +use crate::xkbcommon::XkbKeymap; pub struct State { + pub xkb_ctx: XkbContext, + pub default_keymap: Rc, pub eng: Rc, pub el: Rc, pub render_ctx: CloneCell>>, @@ -31,21 +34,36 @@ pub struct State { pub globals: Globals, pub output_ids: OutputIds, pub seat_ids: SeatIds, + pub kb_ids: KeyboardIds, + pub mouse_ids: MouseIds, pub node_ids: NodeIds, pub root: Rc, pub backend_events: AsyncQueue, pub output_handlers: RefCell>>, - pub seats: RefCell>, + pub mouse_handlers: RefCell>, + pub kb_handlers: RefCell>, pub outputs: CopyHashMap>, pub seat_queue: LinkedList>, pub slow_clients: AsyncQueue>, pub none_surface_ext: Rc, pub tree_changed_sent: Cell, + pub config: CloneCell>>, } -pub struct SeatData { +pub struct MouseData { pub handler: SpawnedFuture<()>, - pub tree_changed: Rc, + pub id: MouseId, + pub data: Rc +} + +pub struct KeyboardData { + pub handler: SpawnedFuture<()>, + pub id: KeyboardId, + pub data: Rc +} + +pub struct DeviceHandlerData { + pub seat: CloneCell>>, } impl State { @@ -73,9 +91,9 @@ impl State { if self.tree_changed_sent.replace(true) { return; } - let seats = self.seats.borrow(); + let seats = self.globals.seats.lock(); for seat in seats.values() { - seat.tree_changed.trigger(); + seat.trigger_tree_changed(); } } } diff --git a/src/tasks/backend.rs b/src/tasks/backend.rs index d0b48542..859815b8 100644 --- a/src/tasks/backend.rs +++ b/src/tasks/backend.rs @@ -1,10 +1,8 @@ -use crate::backend::{BackendEvent, Output, Seat}; -use crate::state::SeatData; +use crate::backend::{BackendEvent, Output}; use crate::tasks::output::OutputHandler; -use crate::tasks::seat::SeatHandler; -use crate::utils::asyncevent::AsyncEvent; use crate::State; use std::rc::Rc; +use crate::tasks::device; pub struct BackendEventHandler { pub state: Rc, @@ -21,7 +19,8 @@ impl BackendEventHandler { fn handle_event(&mut self, event: BackendEvent) { match event { BackendEvent::NewOutput(output) => self.handle_new_output(output), - BackendEvent::NewSeat(seat) => self.handle_new_seat(seat), + BackendEvent::NewMouse(s) => device::handle(&self.state, s), + BackendEvent::NewKeyboard(s) => device::handle(&self.state, s), } } @@ -34,22 +33,4 @@ impl BackendEventHandler { let future = self.state.eng.spawn(oh.handle()); self.state.output_handlers.borrow_mut().insert(id, future); } - - fn handle_new_seat(&mut self, seat: Rc) { - let id = seat.id(); - let tree_changed = Rc::new(AsyncEvent::default()); - let oh = SeatHandler { - state: self.state.clone(), - seat, - tree_changed: tree_changed.clone(), - }; - let handler = self.state.eng.spawn(oh.handle()); - self.state.seats.borrow_mut().insert( - id, - SeatData { - handler, - tree_changed, - }, - ); - } } diff --git a/src/tasks/device.rs b/src/tasks/device.rs new file mode 100644 index 00000000..9db48328 --- /dev/null +++ b/src/tasks/device.rs @@ -0,0 +1,157 @@ +use crate::backend::{Keyboard, KeyboardEvent, Mouse, MouseEvent}; +use crate::ifs::wl_seat::WlSeatGlobal; +use crate::utils::asyncevent::AsyncEvent; +use crate::State; +use std::rc::Rc; +use crate::async_engine::SpawnedFuture; +use crate::config::ConfigProxy; +use crate::state::{DeviceHandlerData, KeyboardData, MouseData}; + +pub trait DeviceApi: 'static { + type Event; + + fn on_change(&self, cb: Rc); + fn announce(&self, config: &ConfigProxy); + fn announce_del(&self, config: &ConfigProxy); + fn removed(&self) -> bool; + fn add(&self, state: &State, handler: SpawnedFuture<()>, data: Rc); + fn remove(&self, state: &State); + fn event(&self) -> Option; + fn send(seat: &Rc, event: Self::Event); +} + +impl DeviceApi for dyn Keyboard { + type Event = KeyboardEvent; + + fn on_change(&self, cb: Rc) { + self.on_change(cb); + } + + fn announce(&self, config: &ConfigProxy) { + config.new_keyboard(self.id()); + } + + fn announce_del(&self, config: &ConfigProxy) { + config.del_keyboard(self.id()); + } + + fn removed(&self) -> bool { + self.removed() + } + + fn add(&self, state: &State, handler: SpawnedFuture<()>, data: Rc) { + state.kb_handlers.borrow_mut().insert(self.id(), KeyboardData { + handler, + id: self.id(), + data, + }); + } + + fn remove(&self, state: &State) { + state.kb_handlers.borrow_mut().remove(&self.id()); + } + + fn event(&self) -> Option { + self.event() + } + + fn send(seat: &Rc, event: Self::Event) { + seat.kb_event(event); + } +} + +impl DeviceApi for dyn Mouse { + type Event = MouseEvent; + + fn on_change(&self, cb: Rc) { + self.on_change(cb); + } + + fn announce(&self, config: &ConfigProxy) { + config.new_mouse(self.id()); + } + + fn announce_del(&self, config: &ConfigProxy) { + config.del_mouse(self.id()); + } + + fn removed(&self) -> bool { + self.removed() + } + + fn add(&self, state: &State, handler: SpawnedFuture<()>, data: Rc) { + state.mouse_handlers.borrow_mut().insert(self.id(), MouseData { + handler, + id: self.id(), + data, + }); + } + + fn remove(&self, state: &State) { + state.mouse_handlers.borrow_mut().remove(&self.id()); + } + + fn event(&self) -> Option { + self.event() + } + + fn send(seat: &Rc, event: Self::Event) { + seat.mouse_event(event); + } +} + +pub fn handle(state: &Rc, dev: Rc) { + let data = Rc::new(DeviceHandlerData { + seat: Default::default(), + }); + let oh = DeviceHandler { + state: state.clone(), + dev: dev.clone(), + data: data.clone(), + }; + let handler = state.eng.spawn(oh.handle()); + dev.add(&state, handler, data); +} + +pub struct DeviceHandler { + pub state: Rc, + pub dev: Rc, + pub data: Rc, +} + +impl DeviceHandler { + pub async fn handle(self) { + let ae = Rc::new(AsyncEvent::default()); + { + let ae = ae.clone(); + self.dev.on_change(Rc::new(move || ae.trigger())); + } + if let Some(config) = self.state.config.get() { + self.dev.announce(&config); + } + loop { + if self.dev.removed() { + break; + } + if let Some(seat) = self.data.seat.get() { + let mut any_events = false; + while let Some(event) = self.dev.event() { + T::send(&seat, event); + any_events = true; + } + if any_events { + seat.mark_last_active(); + } + } else { + while self.dev.event().is_some() { + // nothing + } + } + ae.triggered().await; + } + if let Some(config) = self.state.config.get() { + self.dev.announce_del(&config); + } + self.dev.remove(&self.state); + } +} diff --git a/src/tasks/mod.rs b/src/tasks/mod.rs index 5e1ffbb7..ba486682 100644 --- a/src/tasks/mod.rs +++ b/src/tasks/mod.rs @@ -1,7 +1,7 @@ mod backend; mod output; -mod seat; mod slow_clients; +mod device; use crate::tasks::backend::BackendEventHandler; use crate::tasks::slow_clients::SlowClientHandler; diff --git a/src/tasks/seat.rs b/src/tasks/seat.rs deleted file mode 100644 index ba0ab712..00000000 --- a/src/tasks/seat.rs +++ /dev/null @@ -1,60 +0,0 @@ -use crate::backend::Seat; -use crate::ifs::wl_seat::WlSeatGlobal; -use crate::utils::asyncevent::AsyncEvent; -use crate::State; -use std::rc::Rc; - -pub struct SeatHandler { - pub state: Rc, - pub seat: Rc, - pub tree_changed: Rc, -} - -impl SeatHandler { - pub async fn handle(self) { - let ae = Rc::new(AsyncEvent::default()); - { - let ae = ae.clone(); - self.seat.on_change(Rc::new(move || ae.trigger())); - } - let name = self.state.globals.name(); - let global = Rc::new(WlSeatGlobal::new( - name, - &self.state, - &self.seat, - &self.tree_changed, - )); - let _tree_changed = self.state.eng.spawn(tree_changed( - self.state.clone(), - global.clone(), - self.tree_changed.clone(), - )); - let mut _node = self.state.seat_queue.add_last(global.clone()); - self.state.add_global(&global); - loop { - if self.seat.removed() { - break; - } - let mut any_events = false; - while let Some(event) = self.seat.event() { - global.event(event); - any_events = true; - } - if any_events { - _node = self.state.seat_queue.add_last(global.clone()); - } - ae.triggered().await; - } - global.set_cursor(None); - let _ = self.state.remove_global(&*global); - self.state.seats.borrow_mut().remove(&self.seat.id()); - } -} - -async fn tree_changed(state: Rc, global: Rc, tree_changed: Rc) { - loop { - tree_changed.triggered().await; - state.tree_changed_sent.set(false); - global.tree_changed(); - } -} diff --git a/src/tree/container.rs b/src/tree/container.rs index a39e2ab2..f36b6856 100644 --- a/src/tree/container.rs +++ b/src/tree/container.rs @@ -1,7 +1,7 @@ -use crate::backend::{KeyState, SeatId}; +use crate::backend::{KeyState}; use crate::cursor::KnownCursor; use crate::fixed::Fixed; -use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal, BTN_LEFT}; +use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal, BTN_LEFT, SeatId}; use crate::rect::Rect; use crate::render::Renderer; use crate::tree::{FindTreeResult, FoundNode, Node, NodeId, WorkspaceNode}; @@ -14,6 +14,7 @@ use std::fmt::{Debug, Formatter}; use std::mem; use std::ops::DerefMut; use std::rc::Rc; +use i4config::Direction; #[allow(dead_code)] #[derive(Copy, Clone, Debug, Eq, PartialEq)] @@ -421,6 +422,52 @@ impl Node for ContainerNode { self.seat_state.destroy_node(self); } + fn do_focus(self: Rc, seat: &Rc, direction: Direction) { + let node = match direction { + Direction::Left => self.children.last(), + Direction::Down => self.children.first(), + Direction::Up => self.children.last(), + Direction::Right => self.children.first(), + }; + if let Some(node) = node { + node.node.clone().do_focus(seat, direction); + } + } + + fn move_focus_from_child(&self, seat: &Rc, child: &dyn Node, direction: Direction) { + let children = self.child_nodes.borrow_mut(); + let child = match children.get(&child.id()) { + Some(c) => c, + _ => return, + }; + let in_line = match self.split.get() { + ContainerSplit::Horizontal => matches!(direction, Direction::Left | Direction::Right), + ContainerSplit::Vertical => matches!(direction, Direction::Up | Direction::Down), + }; + if !in_line { + self.parent.get().move_focus_from_child(seat, self, direction); + return; + } + let prev = match direction { + Direction::Left => true, + Direction::Down => false, + Direction::Up => true, + Direction::Right => false, + }; + let sibling = match prev { + true => child.prev(), + false => child.next() + }; + let sibling = match sibling { + Some(s) => s, + None => { + self.parent.get().move_focus_from_child(seat, self, direction); + return; + } + }; + sibling.node.clone().do_focus(seat, direction); + } + fn absolute_position(&self) -> Rect { Rect::new_sized( self.abs_x1.get(), diff --git a/src/tree/mod.rs b/src/tree/mod.rs index f05c842f..33a5d16b 100644 --- a/src/tree/mod.rs +++ b/src/tree/mod.rs @@ -17,6 +17,7 @@ use std::cell::{Cell, RefCell}; use std::fmt::{Debug, Display, Formatter}; use std::ops::Deref; use std::rc::Rc; +use i4config::Direction; pub use workspace::*; mod container; @@ -66,6 +67,22 @@ pub trait Node { fn seat_state(&self) -> &NodeSeatState; fn destroy_node(&self, detach: bool); + fn do_focus(self: Rc, seat: &Rc, direction: Direction) { + let _ = seat; + let _ = direction; + } + + fn move_focus(&self, seat: &Rc, direction: Direction) { + let _ = seat; + let _ = direction; + } + + fn move_focus_from_child(&self, seat: &Rc, child: &dyn Node, direction: Direction) { + let _ = seat; + let _ = direction; + let _ = child; + } + fn absolute_position(&self) -> Rect { Rect::new_empty(0, 0) } @@ -78,10 +95,14 @@ pub trait Node { let _ = active; } - fn key(&self, seat: &WlSeatGlobal, key: u32, state: u32, mods: Option) { + fn key(&self, seat: &WlSeatGlobal, key: u32, state: u32) { let _ = seat; let _ = key; let _ = state; + } + + fn mods(&self, seat: &WlSeatGlobal, mods: ModifierState) { + let _ = seat; let _ = mods; } diff --git a/src/utils/linkedlist.rs b/src/utils/linkedlist.rs index 68f28186..33e5c1c7 100644 --- a/src/utils/linkedlist.rs +++ b/src/utils/linkedlist.rs @@ -2,6 +2,7 @@ use crate::utils::ptr_ext::PtrExt; use crate::NumCell; use std::cell::Cell; use std::fmt::{Debug, Formatter}; +use std::mem; use std::ops::Deref; use std::ptr::NonNull; @@ -153,6 +154,7 @@ impl Drop for RevLinkedListIter { } } +#[repr(transparent)] pub struct LinkedNode { data: NonNull>, } @@ -164,13 +166,14 @@ impl Debug for LinkedNode { } impl Deref for LinkedNode { - type Target = T; + type Target = NodeRef; fn deref(&self) -> &Self::Target { - unsafe { self.data.as_ref().data.as_ref().unwrap_unchecked() } + unsafe { mem::transmute(self) } } } +#[repr(transparent)] pub struct NodeRef { data: NonNull>, } @@ -215,10 +218,12 @@ impl NodeRef { unsafe { append(self.data, t) } } - pub fn prev(&self) -> Option> { + fn peer(&self, peer: F) -> Option> + where F: FnOnce(&NodeData) -> &Cell>>, + { unsafe { let data = self.data.as_ref(); - let other = data.prev.get(); + let other = peer(&data).get(); if other.as_ref().data.is_some() { other.as_ref().rc.fetch_add(1); Some(NodeRef { data: other }) @@ -227,6 +232,14 @@ impl NodeRef { } } } + + pub fn prev(&self) -> Option> { + self.peer(|d| &d.prev) + } + + pub fn next(&self) -> Option> { + self.peer(|d| &d.next) + } } struct NodeData { diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 77112db6..29c14367 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -11,3 +11,4 @@ pub mod ptr_ext; pub mod queue; pub mod smallmap; pub mod vec_ext; +pub mod stack; diff --git a/src/utils/stack.rs b/src/utils/stack.rs new file mode 100644 index 00000000..382cd70b --- /dev/null +++ b/src/utils/stack.rs @@ -0,0 +1,28 @@ +use std::cell::UnsafeCell; +use crate::utils::ptr_ext::MutPtrExt; + +pub struct Stack { + vec: UnsafeCell>, +} + +impl Default for Stack { + fn default() -> Self { + Self { + vec: Default::default(), + } + } +} + +impl Stack { + pub fn push(&self, v: T) { + unsafe { + self.vec.get().deref_mut().push(v); + } + } + + pub fn pop(&self) -> Option { + unsafe { + self.vec.get().deref_mut().pop() + } + } +} diff --git a/src/xkbcommon/mod.rs b/src/xkbcommon/mod.rs index 9c0d7fb7..b69c7c6b 100644 --- a/src/xkbcommon/mod.rs +++ b/src/xkbcommon/mod.rs @@ -7,12 +7,14 @@ include!(concat!(env!("OUT_DIR"), "/xkbcommon_tys.rs")); use bstr::{BStr, ByteSlice}; pub use consts::*; use std::ffi::{CStr, VaList}; +use std::io::Write; use std::ops::Deref; use std::ptr; +use std::rc::Rc; use crate::utils::ptr_ext::PtrExt; use thiserror::Error; -use uapi::c; +use uapi::{c, OwnedFd}; #[derive(Debug, Error)] pub enum XkbCommonError { @@ -20,8 +22,8 @@ pub enum XkbCommonError { CreateContext, #[error("Could not create an xkbcommon state")] CreateState, - #[error("Could not create keymap from names")] - KeymapFromNames, + #[error("Could not create keymap from buffer")] + KeymapFromBuffer, #[error("Could not convert the keymap to a string")] AsStr, } @@ -30,6 +32,11 @@ struct xkb_context; struct xkb_keymap; struct xkb_state; +type xkb_keycode_t = u32; +type xkb_layout_index_t = u32; +type xkb_level_index_t = u32; +type xkb_keysym_t = u32; + #[repr(C)] struct xkb_rule_names { rules: *const c::c_char, @@ -55,6 +62,7 @@ impl Default for xkb_rule_names { extern "C" { fn xkb_context_new(flags: xkb_context_flags) -> *mut xkb_context; fn xkb_context_unref(context: *mut xkb_context); + fn xkb_context_set_log_verbosity(context: *mut xkb_context, verbosity: c::c_int); fn xkb_context_set_log_fn( context: *mut xkb_context, log_fn: unsafe extern "C" fn( @@ -64,9 +72,11 @@ extern "C" { args: VaList, ), ); - fn xkb_keymap_new_from_names( + fn xkb_keymap_new_from_buffer( context: *mut xkb_context, - name: *const xkb_rule_names, + buffer: *const u8, + length: usize, + format: xkb_keymap_format, flags: xkb_keymap_compile_flags, ) -> *mut xkb_keymap; fn xkb_keymap_get_as_string( @@ -74,6 +84,14 @@ extern "C" { format: xkb_keymap_format, ) -> *mut c::c_char; fn xkb_keymap_unref(keymap: *mut xkb_keymap); + // fn xkb_keymap_ref(keymap: *mut xkb_keymap) -> *mut xkb_keymap; + fn xkb_keymap_key_get_syms_by_level( + keymap: *mut xkb_keymap, + key: xkb_keycode_t, + layout: xkb_layout_index_t, + level: xkb_level_index_t, + syms_out: *mut *const xkb_keysym_t, + ) -> c::c_int; fn xkb_state_unref(state: *mut xkb_state); fn xkb_state_new(keymap: *mut xkb_keymap) -> *mut xkb_state; #[allow(dead_code)] @@ -99,19 +117,47 @@ impl XkbContext { return Err(XkbCommonError::CreateContext); } unsafe { + xkb_context_set_log_verbosity(res, 10); xkb_context_set_log_fn(res, xkbcommon_logger); } Ok(Self { context: res }) } - pub fn default_keymap(&self) -> Result { - unsafe { - let names = Default::default(); - let keymap = xkb_keymap_new_from_names(self.context, &names, 0); - if keymap.is_null() { - return Err(XkbCommonError::KeymapFromNames); + fn raw_to_map(raw: *mut xkb_keymap) -> Result, XkbCommonError> { + let res = + unsafe { xkb_keymap_get_as_string(raw, XKB_KEYMAP_FORMAT_TEXT_V1.raw() as _) }; + if res.is_null() { + unsafe { + xkb_keymap_unref(raw); } - Ok(XkbKeymap { keymap }) + return Err(XkbCommonError::AsStr); + } + let str = XkbKeymapStr { + s: unsafe { CStr::from_ptr(res).to_bytes().as_bstr() }, + }; + let mut memfd = + uapi::memfd_create("keymap", c::MFD_CLOEXEC | c::MFD_ALLOW_SEALING).unwrap(); + memfd.write_all(str.as_bytes()).unwrap(); + memfd.write_all(&[0]).unwrap(); + uapi::lseek(memfd.raw(), 0, c::SEEK_SET).unwrap(); + uapi::fcntl_add_seals( + memfd.raw(), + c::F_SEAL_SEAL | c::F_SEAL_GROW | c::F_SEAL_SHRINK | c::F_SEAL_WRITE, + ).unwrap(); + Ok(Rc::new(XkbKeymap { + keymap: raw, + map: Rc::new(memfd), + map_len: str.len() + 1, + })) + } + + pub fn keymap_from_str(&self, s: &str) -> Result, XkbCommonError> { + unsafe { + let keymap = xkb_keymap_new_from_buffer(self.context, s.as_bytes().as_ptr(), s.len(), XKB_KEYMAP_FORMAT_TEXT_V1.raw(), 0); + if keymap.is_null() { + return Err(XkbCommonError::KeymapFromBuffer); + } + Self::raw_to_map(keymap) } } } @@ -126,31 +172,24 @@ impl Drop for XkbContext { pub struct XkbKeymap { keymap: *mut xkb_keymap, + pub map: Rc, + pub map_len: usize, } impl XkbKeymap { - pub fn as_str(&self) -> Result { - let res = - unsafe { xkb_keymap_get_as_string(self.keymap, XKB_KEYMAP_FORMAT_TEXT_V1.raw() as _) }; - if res.is_null() { - return Err(XkbCommonError::AsStr); - } - Ok(XkbKeymapStr { - s: unsafe { CStr::from_ptr(res).to_bytes().as_bstr() }, - }) - } - - pub fn state(&self) -> Result { + pub fn state(self: &Rc) -> Result { let res = unsafe { xkb_state_new(self.keymap) }; if res.is_null() { return Err(XkbCommonError::CreateState); } Ok(XkbState { + map: self.clone(), state: res, mods: ModifierState { mods_depressed: 0, mods_latched: 0, mods_locked: 0, + mods_effective: 0, group: 0, }, }) @@ -188,10 +227,12 @@ pub struct ModifierState { pub mods_depressed: u32, pub mods_latched: u32, pub mods_locked: u32, + pub mods_effective: u32, pub group: u32, } pub struct XkbState { + map: Rc, state: *mut xkb_state, mods: ModifierState, } @@ -212,6 +253,8 @@ impl XkbState { xkb_state_serialize_mods(self.state, XKB_STATE_MODS_LATCHED.raw() as _); self.mods.mods_locked = xkb_state_serialize_mods(self.state, XKB_STATE_MODS_LOCKED.raw() as _); + self.mods.mods_effective = + self.mods.mods_depressed | self.mods.mods_latched | self.mods.mods_locked; self.mods.group = xkb_state_serialize_layout(self.state, XKB_STATE_LAYOUT_EFFECTIVE.raw() as _); Some(self.mods) @@ -220,6 +263,24 @@ impl XkbState { } } } + + pub fn unmodified_keysyms(&self, key: u32) -> &[xkb_keysym_t] { + let mut res = ptr::null(); + unsafe { + let num = xkb_keymap_key_get_syms_by_level( + self.map.keymap, + key + 8, + self.mods.group, + 0, + &mut res, + ); + if num > 0 { + std::slice::from_raw_parts(res, num as usize) + } else { + &[] + } + } + } } impl Drop for XkbState { @@ -242,10 +303,10 @@ unsafe extern "C" fn xkbcommon_logger( let mut buf = ptr::null_mut(); let res = vasprintf(&mut buf, format, args); if res < 0 { - log::warn!("Could not vasprintf"); + log::error!("Could not vasprintf"); + return; } let buf = std::slice::from_raw_parts(buf as *const u8, res as usize); - let buf = buf.as_bstr(); let level = match XkbLogLevel(level) { XKB_LOG_LEVEL_CRITICAL | XKB_LOG_LEVEL_ERROR => log::Level::Error, XKB_LOG_LEVEL_WARNING => log::Level::Warn, @@ -253,5 +314,5 @@ unsafe extern "C" fn xkbcommon_logger( XKB_LOG_LEVEL_DEBUG => log::Level::Debug, _ => log::Level::Error, }; - log::log!(level, "xkbcommon: {}", buf); + log::log!(level, "xkbcommon: {}", buf.trim_end().as_bstr()); }