]> git.gir.st - sendHID.git/blob - scancodes.h
moved tolay() from main.c to scancodes.c
[sendHID.git] / scancodes.h
1 #ifndef __SCANCODES_H__
2 #define __SCANCODES_H__
3
4 #define UTF8_MAX_LENGTH 4
5
6 #define MOD_NONE 0
7 #define MOD_LCTRL 1<<0
8 #define MOD_LSHIFT 1<<1
9 #define MOD_LALT 1<<2
10 #define MOD_LSUPER 1<<3
11 #define MOD_RCTRL 1<<4
12 #define MOD_RSHIFT 1<<5
13 #define MOD_RALT 1<<6
14 #define MOD_RSUPER 1<<7
15
16 struct layout {
17 unsigned short key; //scancode of normal key
18 //if this is NULL, the key does not exist in this layout.
19 unsigned short mod; //bitmask of modifier keys
20 short is_dead; //is dead key (needs to be pressed twice)
21 };
22 struct keysym {
23 char sym [UTF8_MAX_LENGTH]; //utf-8 encoded key symbol
24 struct layout en_us; //substructure for this layout
25 struct layout de_at;
26 struct layout de_nd;
27 unsigned int unicode; //the unicode number to send via alt+numpad or ^U if char is not available in a keyboard layout
28 };
29
30 enum kbdl { //keyboard layouts:
31 na_NA, //reserved
32 en_US,
33 de_AT,
34 de_ND //de_AT-nodeadkeys
35 };
36
37 struct keysym* toscan (const char* utf8);//returns the layout struct of a keysym
38 struct layout* tolay (struct keysym* s, enum kbdl layout); //returns layout struct from keysym struct
39 #endif
Imprint / Impressum