mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
xorg ulong -> KeySym.
This commit is contained in:
parent
7f226842df
commit
b169195b69
@ -7,17 +7,17 @@ static int REGISTERED = 0;
|
|||||||
static int DIRTY = 0;
|
static int DIRTY = 0;
|
||||||
|
|
||||||
typedef struct linked_list {
|
typedef struct linked_list {
|
||||||
unsigned long number;
|
KeySym keysym;
|
||||||
KeyCode keycode;
|
KeyCode keycode;
|
||||||
struct linked_list *next;
|
struct linked_list *next;
|
||||||
} node;
|
} node;
|
||||||
|
|
||||||
node *head = NULL;
|
node *head = NULL;
|
||||||
|
|
||||||
void insertItem(unsigned long value, KeyCode keycode) {
|
void insertItem(KeySym keysym, KeyCode keycode) {
|
||||||
node *temp_node = (node *) malloc(sizeof(node));
|
node *temp_node = (node *) malloc(sizeof(node));
|
||||||
|
|
||||||
temp_node->number = value;
|
temp_node->keysym = keysym;
|
||||||
temp_node->keycode = keycode;
|
temp_node->keycode = keycode;
|
||||||
temp_node->next = NULL;
|
temp_node->next = NULL;
|
||||||
|
|
||||||
@ -28,12 +28,12 @@ void insertItem(unsigned long value, KeyCode keycode) {
|
|||||||
head = temp_node;
|
head = temp_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
void deleteItem(unsigned long value) {
|
void deleteItem(KeySym keysym) {
|
||||||
node *myNode = head, *previous = NULL;
|
node *myNode = head, *previous = NULL;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (myNode) {
|
while (myNode) {
|
||||||
if (myNode->number == value) {
|
if (myNode->keysym == keysym) {
|
||||||
if (!previous)
|
if (!previous)
|
||||||
head = myNode->next;
|
head = myNode->next;
|
||||||
else
|
else
|
||||||
@ -53,12 +53,12 @@ void deleteItem(unsigned long value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node *searchItemNode(unsigned long value) {
|
node *searchItemNode(KeySym keysym) {
|
||||||
node *searchNode = head;
|
node *searchNode = head;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (searchNode) {
|
while (searchNode) {
|
||||||
if (searchNode->number == value) {
|
if (searchNode->keysym == keysym) {
|
||||||
return searchNode;
|
return searchNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ KeyCode XkbKeysymToKeycode(Display *dpy, KeySym keysym) {
|
|||||||
return keycode;
|
return keycode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XKey(unsigned long key, int down) {
|
void XKey(KeySym key, int down) {
|
||||||
Display *display = getXDisplay();
|
Display *display = getXDisplay();
|
||||||
KeyCode code = 0;
|
KeyCode code = 0;
|
||||||
node *compareNode;
|
node *compareNode;
|
||||||
|
@ -75,7 +75,7 @@ func KeyDown(code uint64) error {
|
|||||||
|
|
||||||
debounce_key[code] = time.Now()
|
debounce_key[code] = time.Now()
|
||||||
|
|
||||||
C.XKey(C.ulong(code), C.int(1))
|
C.XKey(C.KeySym(code), C.int(1))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ func KeyUp(code uint64) error {
|
|||||||
|
|
||||||
delete(debounce_key, code)
|
delete(debounce_key, code)
|
||||||
|
|
||||||
C.XKey(C.ulong(code), C.int(0))
|
C.XKey(C.KeySym(code), C.int(0))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user