svkbd

simple virtual keyboard
git clone git://git.suckless.org/svkbd
Log | Files | Refs | README | LICENSE

layout.mobile-simple.h (9487B)


      1 #define KEYS 43
      2 
      3 static Key keys_lazy_en[KEYS] = {
      4 	{ 0, 0, XK_q, 1 },
      5 	{ 0, 0, XK_w, 1 },
      6 	{ 0, 0, XK_e, 1 },
      7 	{ 0, 0, XK_r, 1 },
      8 	{ 0, 0, XK_t, 1 },
      9 	{ 0, 0, XK_y, 1 },
     10 	{ 0, 0, XK_u, 1 },
     11 	{ 0, 0, XK_i, 1 },
     12 	{ 0, 0, XK_o, 1 },
     13 	{ 0, 0, XK_p, 1 },
     14 
     15 	{ 0 },
     16 
     17 	{ 0, 0, XK_a, 1 },
     18 	{ 0, 0, XK_s, 1 },
     19 	{ 0, 0, XK_d, 1 },
     20 	{ 0, 0, XK_f, 1 },
     21 	{ 0, 0, XK_g, 1 },
     22 	{ 0, 0, XK_h, 1 },
     23 	{ 0, 0, XK_j, 1 },
     24 	{ 0, 0, XK_k, 1 },
     25 	{ 0, 0, XK_l, 1 },
     26 	{ "'", 0, XK_apostrophe, 1 },
     27 
     28 	{ 0 },
     29 
     30 	{ "↑", 0, XK_Shift_L, 1 },
     31 	{ 0, 0, XK_z, 1 },
     32 	{ 0, 0, XK_x, 1 },
     33 	{ 0, 0, XK_c, 1 },
     34 	{ 0, 0, XK_v, 1 },
     35 	{ 0, 0, XK_b, 1 },
     36 	{ 0, 0, XK_n, 1 },
     37 	{ 0, 0, XK_m, 1 },
     38 	{ "Tab", 0, XK_Tab, 1 },
     39 	{ "⌫", 0, XK_BackSpace, 1 },
     40 
     41 	{ 0 },
     42 
     43 	{ "?123", 0, XK_Cancel, 3 },
     44 	{ "-", 0, XK_minus, 2 },
     45 	{ "☺", 0, 0x101f642, 2 },
     46 	{ "Ctl", 0, XK_Control_L, 2 },
     47 	{ "Alt", 0, XK_Alt_L, 2 },
     48 	{ "", 0, XK_space, 4 },
     49 	{ ".", 0, XK_period, 2 },
     50 	{ "↲Enter", 0, XK_Return, 3 }
     51 };
     52 
     53 static Key keys_symbols[KEYS] = {
     54 	{ "1", 0, XK_1, 1 },
     55 	{ "2", 0, XK_2, 1 },
     56 	{ "3", 0, XK_3, 1 },
     57 	{ "4", 0, XK_4, 1 },
     58 	{ "5", 0, XK_5, 1 },
     59 	{ "6", 0, XK_6, 1 },
     60 	{ "7", 0, XK_7, 1 },
     61 	{ "8", 0, XK_8, 1 },
     62 	{ "9", 0, XK_9, 1 },
     63 	{ "0", 0, XK_0, 1 },
     64 
     65 	{ 0 },
     66 
     67 	{ "!", 0, XK_1, 1, XK_Shift_L },
     68 	{ "@", 0, XK_2, 1, XK_Shift_L },
     69 	{ "#", 0, XK_3, 1, XK_Shift_L },
     70 	{ "$", 0, XK_4, 1, XK_Shift_L },
     71 	{ "%", 0, XK_5, 1, XK_Shift_L },
     72 	{ "^", 0, XK_6, 1, XK_Shift_L },
     73 	{ "&", 0, XK_7, 1, XK_Shift_L },
     74 	{ "*", 0, XK_8, 1, XK_Shift_L },
     75 	{ "(", 0, XK_9, 1, XK_Shift_L },
     76 	{ ")", 0, XK_0, 1, XK_Shift_L },
     77 
     78 	{ 0 },
     79 
     80 	{ "Esc", 0, XK_Escape, 1 },
     81 	{ "~", 0, XK_grave, 1, XK_Shift_L },
     82 	{ "\\", 0, XK_backslash, 1 },
     83 	{ "|", 0, XK_backslash, 1, XK_Shift_L },
     84 	{ "←", 0, XK_Left, 1 },
     85 	{ "↓", 0, XK_Down, 1 },
     86 	{ "↑", 0, XK_Up, 1 },
     87 	{ "→", 0, XK_Right, 1 },
     88 	{ "Tab", 0, XK_Tab, 1 },
     89 	{ "⌫", 0, XK_BackSpace, 1 },
     90 
     91 	{ 0 },
     92 
     93 	{ "abc", 0, XK_Mode_switch, 3 },
     94 	{ "-", 0, XK_minus, 2 },
     95 	{ "↺", 0, XK_Cancel, 2 },
     96 	{ "Ctl", 0, XK_Control_L, 2 },
     97 	{ "Alt", 0, XK_Alt_L, 2 },
     98 	{ "", 0, XK_space, 4 },
     99 	{ ".", 0, XK_period, 2 },
    100 	{ "↲Enter", 0, XK_Return, 3 }
    101 };
    102 
    103 static Key keys_functions[KEYS] = {
    104 	{ "Esc", 0, XK_Escape, 1 },
    105 	{ "F1", 0, XK_F1, 1 },
    106 	{ "F2", 0, XK_F2, 1 },
    107 	{ "F3", 0, XK_F3, 1 },
    108 	{ "F4", 0, XK_F4, 1 },
    109 	{ "F5", 0, XK_F5, 1 },
    110 	{ "F6", 0, XK_F6, 1 },
    111 	{ "F7", 0, XK_F7, 1 },
    112 	{ "F8", 0, XK_F8, 1 },
    113 	{ "F9", 0, XK_F9, 1 },
    114 	{ "F10", 0, XK_F10, 1 },
    115 
    116 	{ 0 },
    117 
    118 	{ "≅", 0, XK_KP_Insert, 1 },
    119 	{ "▶", 0, XF86XK_AudioPlay, 1 },
    120 	{ "●", 0, XF86XK_AudioRecord, 1 },
    121 	{ "■", 0, XF86XK_AudioStop, 1 },
    122 	{ "◂◂", 0, XF86XK_AudioPrev, 1 },
    123 	{ "▸▸", 0, XF86XK_AudioNext, 1 },
    124 	{ "♫M", 0, XF86XK_AudioMute, 1 },
    125 	{ "♫-", 0, XF86XK_AudioLowerVolume, 1 },
    126 	{ "♫+", 0, XF86XK_AudioRaiseVolume, 1 },
    127 	{ "☀-", 0, XF86XK_MonBrightnessDown, 1 },
    128 	{ "☀+", 0, XF86XK_MonBrightnessUp, 1 },
    129 
    130 	{ 0 },
    131 
    132 	{ "abc", 0, XK_Mode_switch, 1 },
    133 	{ "Del", 0, XK_Delete, 1 },
    134 	{ "⇤", 0, XK_Home, 1 },
    135 	{ "←", 0, XK_Left, 1 },
    136 	{ "→", 0, XK_Right, 1 },
    137 	{ "⇥", 0, XK_End, 1 },
    138 	{ "⇊", 0, XK_Next, 1 },
    139 	{ "⇈", 0, XK_Prior, 1 },
    140 	{ "Tab", 0, XK_Tab, 1 },
    141 	{ "⌫", 0, XK_BackSpace, 2 },
    142 
    143 	{ 0 },
    144 
    145 	{ "↺", 0, XK_Cancel, 1},
    146 	{ "Shift", 0, XK_Shift_L, 2 },
    147 	{ "Ctrl", 0, XK_Control_L, 1 },
    148 	{ "Alt", 0, XK_Alt_L, 1 },
    149 	{ "", 0, XK_space, 2 },
    150 	{ "↓", 0, XK_Down, 1 },
    151 	{ "↑", 0, XK_Up, 1 },
    152 	{ "↲ Enter", 0, XK_Return, 2 },
    153 };
    154 
    155 #define DIALER_KEYS 27
    156 
    157 static Key keys_dialer[DIALER_KEYS] = {
    158 	{ "Esc", 0, XK_Escape, 1 },
    159 	{ "1!", 0, XK_1, 1 },
    160 	{ "2@", 0, XK_2, 1 },
    161 	{ "3#", 0, XK_3, 1 },
    162 	{ "-_", 0, XK_minus, 1 },
    163 	{ ",<", 0, XK_comma, 1 },
    164 
    165 	{ 0 },
    166 
    167 	{ "Shift", 0, XK_Shift_L, 1 },
    168 	{ "4$", 0, XK_4, 1 },
    169 	{ "5%", 0, XK_5, 1 },
    170 	{ "6^", 0, XK_6, 1 },
    171 	{ "=+", 0, XK_equal, 1 },
    172 	{ "/?", 0, XK_slash, 1 },
    173 
    174 	{ 0 },
    175 
    176 	{ "abc", 0, XK_Mode_switch, 1 },
    177 	{ "7&", 0, XK_7, 1 },
    178 	{ "8*", 0, XK_8, 1 },
    179 	{ "9(", 0, XK_9, 1 },
    180 	{ "⌫", 0, XK_BackSpace, 2 },
    181 
    182 	{ 0 },
    183 
    184 	{ "↺", 0, XK_Cancel, 1},
    185 	{ "", 0, XK_space, 1 },
    186 	{ "0)", 0, XK_0, 1 },
    187 	{ ".>", 0, XK_period, 1 },
    188 	{ "↲ Enter", 0, XK_Return, 2},
    189 };
    190 
    191 #define OVERLAYS 193
    192 
    193 static Key overlay[OVERLAYS] = {
    194 	{ 0, 0, XK_a },
    195 	{ "à", 0, XK_agrave },
    196 	{ "á", 0, XK_aacute },
    197 	{ "â", 0, XK_acircumflex },
    198 	{ "ä", 0, XK_adiaeresis },
    199 	{ "ą", 0, XK_aogonek },
    200 	{ "ã", 0, XK_atilde },
    201 	{ "ā", 0, XK_amacron },
    202 	{ "ă", 0, XK_abreve },
    203 	{ "å", 0, XK_aring },
    204 	{ "æ", 0, XK_ae },
    205 	{ 0, 0, XK_Cancel },
    206 	{ 0, 0, XK_e },
    207 	{ "è", 0, XK_egrave },
    208 	{ "é", 0, XK_eacute },
    209 	{ "ê", 0, XK_ecircumflex },
    210 	{ "ë", 0, XK_ediaeresis },
    211 	{ "ę", 0, XK_eogonek },
    212 	{ "ē", 0, XK_emacron },
    213 	{ "ė", 0, XK_eabovedot },
    214 	{ "ě", 0, XK_ecaron },
    215 	{ 0, 0, XK_Cancel },
    216 	{ 0, 0, XK_y },
    217 	{ "ỳ", 0, XK_ygrave },
    218 	{ "ý", 0, XK_yacute },
    219 	{ "ŷ", 0, XK_ycircumflex },
    220 	{ "ÿ", 0, XK_ydiaeresis },
    221 	{ 0, 0, XK_Cancel },
    222 	{ 0, 0, XK_u },
    223 	{ "ù", 0, XK_ugrave },
    224 	{ "ú", 0, XK_uacute },
    225 	{ "û", 0, XK_ucircumflex },
    226 	{ "ü", 0, XK_udiaeresis },
    227 	{ "ų", 0, XK_uogonek },
    228 	{ "ū", 0, XK_umacron },
    229 	{ "ů", 0, XK_uring},
    230 	{ "ŭ", 0, XK_ubreve},
    231 	{ "ű", 0, XK_udoubleacute },
    232 	{ 0, 0, XK_Cancel },
    233 	{ 0, 0, XK_i },
    234 	{ "ì", 0, XK_igrave },
    235 	{ "í", 0, XK_iacute },
    236 	{ "î", 0, XK_icircumflex },
    237 	{ "ï", 0, XK_idiaeresis },
    238 	{ "į", 0, XK_iogonek },
    239 	{ "ī", 0, XK_imacron },
    240 	{ "ı", 0, XK_idotless },
    241 	{ 0, 0, XK_Cancel },
    242 	{ 0, 0, XK_o },
    243 	{ "ò", 0, XK_ograve },
    244 	{ "ó", 0, XK_oacute },
    245 	{ "ô", 0, XK_ocircumflex },
    246 	{ "ö", 0, XK_odiaeresis },
    247 	{ "ǫ", 0, XK_ogonek },
    248 	{ "õ", 0, XK_otilde },
    249 	{ "ō", 0, XK_omacron },
    250 	{ "ø", 0, XK_oslash },
    251 	{ "ő", 0, XK_odoubleacute },
    252 	{ "œ", 0, XK_oe },
    253 	{ 0, 0, XK_Cancel },
    254 	{ 0, 0, XK_d },
    255 	{ "ď", 0, XK_dcaron },
    256 	{ "ð", 0, XK_eth },
    257 	{ 0, 0, XK_Cancel },
    258 	{ 0, 0, XK_c },
    259 	{ "ç", 0, XK_ccedilla },
    260 	{ "ĉ", 0, XK_ccircumflex },
    261 	{ "č", 0, XK_ccaron },
    262 	{ "ć", 0, XK_cacute },
    263 	{ 0, 0, XK_Cancel },
    264 	{ 0, 0, XK_s },
    265 	{ "ş", 0, XK_scedilla },
    266 	{ "ŝ", 0, XK_scircumflex },
    267 	{ "š", 0, XK_scaron },
    268 	{ "ś", 0, XK_sacute },
    269 	{ "ß", 0, XK_ssharp },
    270 	{ 0, 0, XK_Cancel },
    271 	{ 0, 0, XK_z },
    272 	{ "ž", 0, XK_zcaron },
    273 	{ "ż", 0, XK_zabovedot },
    274 	{ 0, 0, XK_Cancel },
    275 	{ 0, 0, XK_n },
    276 	{ "ñ", 0, XK_ntilde },
    277 	{ "ń", 0, XK_nacute },
    278 	{ "ň", 0, XK_ncaron },
    279 	{ 0, 0, XK_Cancel },
    280 	{ 0, 0, XK_t },
    281 	{ "ț", 0, XK_tcedilla },
    282 	{ "ť", 0, XK_tcaron },
    283 	{ "þ", 0, XK_thorn },
    284 	{ 0, 0, XK_Cancel },
    285 	{ 0, 0, XK_g },
    286 	{ "ĝ", 0, XK_gcircumflex },
    287 	{ "ğ", 0, XK_gbreve },
    288 	{ 0, 0, XK_Cancel },
    289 	{ 0, 0, XK_h },
    290 	{ "ĥ", 0, XK_hcircumflex },
    291 	{ 0, 0, XK_Cancel },
    292 	{ 0, 0, XK_j },
    293 	{ "ĵ", 0, XK_jcircumflex },
    294 	{ 0, 0, XK_Cancel },
    295 	{ 0, 0, XK_l },
    296 	{ "ł", 0, XK_lstroke },
    297 	{ "ľ", 0, XK_lcaron },
    298 	{ 0, 0, XK_Cancel },
    299 	{ 0, 0, XK_r },
    300 	{ "ř", 0, XK_rcaron },
    301 	{ 0, 0, XK_Cancel },
    302 	{ 0, 0, XK_Cyrillic_softsign },
    303 	{ "ъ", 0, XK_Cyrillic_hardsign },
    304 	{ 0, 0, XK_Cancel },
    305 	{ 0, 0, XK_Cyrillic_ie },
    306 	{ "ё", 0, XK_Cyrillic_io },
    307 	{ "э", 0, XK_Cyrillic_e },
    308 	{ "Є", 0, XK_Ukrainian_ie },
    309 	{ 0, 0, XK_Cancel },
    310 	{ 0, 0, XK_Cyrillic_i },
    311 	{ "і", 0, XK_Ukrainian_i },
    312 	{ "ї", 0, XK_Ukrainian_yi },
    313 	{ 0, 0, XK_Cancel },
    314 	{ 0, 0, XK_Cyrillic_u },
    315 	{ "ў", 0, XK_Byelorussian_shortu },
    316 	{ 0, 0, XK_Cancel },
    317 	{ 0, 0, XK_Cyrillic_shorti },
    318 	{ "ј", 0, XK_Cyrillic_je },
    319 	{ 0, 0, XK_Cancel },
    320 	{ 0, 0, XK_Cyrillic_el },
    321 	{ "љ", 0, XK_Cyrillic_lje },
    322 	{ 0, 0, XK_Cancel },
    323 	{ 0, 0, XK_Cyrillic_en },
    324 	{ "њ", 0, XK_Cyrillic_nje },
    325 	{ 0, 0, XK_Cancel },
    326 	{ 0, 0, XK_Cyrillic_tse },
    327 	{ "џ", 0, XK_Cyrillic_dzhe },
    328 	{ 0, 0, XK_Cancel },
    329 	{ 0, 0, XK_Cyrillic_che },
    330 	{ "ћ", 0, XK_Serbian_tshe },
    331 	{ "ђ", 0, XK_Serbian_dje },
    332 	{ 0, 0, XK_Cancel },
    333 	{ "🙂", 0, 0x101f642 },
    334 	{ "😀", 0, 0x101f600 },
    335 	{ "😁", 0, 0x101f601 },
    336 	{ "😂", 0, 0x101f602 },
    337 	{ "😃", 0, 0x101f603 },
    338 	{ "😄", 0, 0x101f604 },
    339 	{ "😅", 0, 0x101f605 },
    340 	{ "😆", 0, 0x101f606 },
    341 	{ "😇", 0, 0x101f607 },
    342 	{ "😈", 0, 0x101f608 },
    343 	{ "😉", 0, 0x101f609 },
    344 	{ "😊", 0, 0x101f60a },
    345 	{ "😋", 0, 0x101f60b },
    346 	{ "😌", 0, 0x101f60c },
    347 	{ "😍", 0, 0x101f60d },
    348 	{ "😎", 0, 0x101f60e },
    349 	{ "😏", 0, 0x101f60f },
    350 	{ "😐", 0, 0x101f610 },
    351 	{ "😒", 0, 0x101f612 },
    352 	{ "😓", 0, 0x101f613 },
    353 	{ "😛", 0, 0x101f61b },
    354 	{ "😮", 0, 0x101f62e },
    355 	{ "😟", 0, 0x101f61f },
    356 	{ "😟", 0, 0x101f620 },
    357 	{ "😢", 0, 0x101f622 },
    358 	{ "😭", 0, 0x101f62d },
    359 	{ "😳", 0, 0x101f633 },
    360 	{ "😴", 0, 0x101f634 },
    361 	{ 0, 0, XK_Cancel },
    362 	{ ".", 0, XK_period, },
    363 	{ ":", 0, XK_colon, 26, XK_Shift_L },
    364 	{ ";", 0, XK_colon, 0 },
    365 	{ "!", 0, XK_1, 0, XK_Shift_L },
    366 	{ "?", 0, XK_slash, 0, XK_Shift_L },
    367 	{ ",", 0, XK_comma, 0 },
    368 	{ 0, 0, XK_Cancel },
    369 	{ "-", 0, XK_minus },
    370 	{ "_", 0, XK_minus, 24, XK_Shift_L },
    371 	{ "+", 0, XK_plus, 0, XK_Shift_L },
    372 	{ "/", 0, XK_slash, 0 },
    373 	{ "*", 0, XK_8, 0, XK_Shift_L },
    374 	{ "=", 0, XK_plus },
    375 	{ 0, 0, XK_Cancel },
    376 	{ "'", 0, XK_apostrophe },
    377 	{ "{", 0, XK_bracketleft, 7, XK_Shift_L },
    378 	{ "}", 0, XK_bracketright, 0, XK_Shift_L },
    379 	{ "[", 0, XK_bracketleft, 0 },
    380 	{ "]", 0, XK_bracketright, 0 },
    381 	{ "<", 0, XK_comma, 6, XK_Shift_L },
    382 	{ ">", 0, XK_period, 0, XK_Shift_L },
    383 	{ "`", 0, XK_grave, 0 },
    384 	{ "\"", 0, XK_apostrophe, 0, XK_Shift_L },
    385 	{ "'", 0, XK_apostrophe },
    386 	{ 0, 0, XK_Cancel },
    387 };
    388 
    389 #define LAYERS 4
    390 
    391 static char* layer_names[LAYERS] = {
    392 	"lazy en",
    393 	"symbols",
    394 	"functions",
    395 	"dialer",
    396 };
    397 
    398 static Key* available_layers[LAYERS] = {
    399 	keys_lazy_en,
    400 	keys_symbols,
    401 	keys_functions,
    402 	keys_dialer,
    403 };
    404 
    405 Buttonmod buttonmods[] = {
    406 	{ XK_Shift_L, Button2 },
    407 	{ XK_Alt_L, Button3 },
    408 };