mirror of
https://github.com/robotn/gohook.git
synced 2025-01-19 06:06:41 +08:00
update code style
This commit is contained in:
parent
ef93345f66
commit
ac6a9e969d
@ -75,8 +75,7 @@ static inline void post_key_event(iohook_event * const event) {
|
|||||||
scancode_to_keycode(event->data.keyboard.keycode),
|
scancode_to_keycode(event->data.keyboard.keycode),
|
||||||
True,
|
True,
|
||||||
0);
|
0);
|
||||||
}
|
} else if (event->type == EVENT_KEY_RELEASED) {
|
||||||
else if (event->type == EVENT_KEY_RELEASED) {
|
|
||||||
XTestFakeKeyEvent(
|
XTestFakeKeyEvent(
|
||||||
properties_disp,
|
properties_disp,
|
||||||
scancode_to_keycode(event->data.keyboard.keycode),
|
scancode_to_keycode(event->data.keyboard.keycode),
|
||||||
@ -111,8 +110,7 @@ static inline void post_key_event(iohook_event * const event) {
|
|||||||
if (event->type == EVENT_KEY_PRESSED) {
|
if (event->type == EVENT_KEY_PRESSED) {
|
||||||
key_event.type = KeyPress;
|
key_event.type = KeyPress;
|
||||||
XSendEvent(properties_disp, InputFocus, False, KeyPressMask, (XEvent *) &key_event);
|
XSendEvent(properties_disp, InputFocus, False, KeyPressMask, (XEvent *) &key_event);
|
||||||
}
|
} else if (event->type == EVENT_KEY_RELEASED) {
|
||||||
else if (event->type == EVENT_KEY_RELEASED) {
|
|
||||||
key_event.type = KeyRelease;
|
key_event.type = KeyRelease;
|
||||||
XSendEvent(properties_disp, InputFocus, False, KeyReleaseMask, (XEvent *) &key_event);
|
XSendEvent(properties_disp, InputFocus, False, KeyReleaseMask, (XEvent *) &key_event);
|
||||||
}
|
}
|
||||||
@ -135,8 +133,7 @@ static inline void post_mouse_button_event(iohook_event * const event) {
|
|||||||
if (event->data.mouse.x != root_x || event->data.mouse.y != root_y) {
|
if (event->data.mouse.x != root_x || event->data.mouse.y != root_y) {
|
||||||
// Move the pointer to the specified position.
|
// Move the pointer to the specified position.
|
||||||
XTestFakeMotionEvent(properties_disp, -1, event->data.mouse.x, event->data.mouse.y, 0);
|
XTestFakeMotionEvent(properties_disp, -1, event->data.mouse.x, event->data.mouse.y, 0);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
query_status = False;
|
query_status = False;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,19 +144,15 @@ static inline void post_mouse_button_event(iohook_event * const event) {
|
|||||||
if (event->data.wheel.rotation < 0) {
|
if (event->data.wheel.rotation < 0) {
|
||||||
XTestFakeButtonEvent(properties_disp, WheelUp, True, 0);
|
XTestFakeButtonEvent(properties_disp, WheelUp, True, 0);
|
||||||
XTestFakeButtonEvent(properties_disp, WheelUp, False, 0);
|
XTestFakeButtonEvent(properties_disp, WheelUp, False, 0);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
XTestFakeButtonEvent(properties_disp, WheelDown, True, 0);
|
XTestFakeButtonEvent(properties_disp, WheelDown, True, 0);
|
||||||
XTestFakeButtonEvent(properties_disp, WheelDown, False, 0);
|
XTestFakeButtonEvent(properties_disp, WheelDown, False, 0);
|
||||||
}
|
}
|
||||||
}
|
} else if (event->type == EVENT_MOUSE_PRESSED) {
|
||||||
else if (event->type == EVENT_MOUSE_PRESSED) {
|
|
||||||
XTestFakeButtonEvent(properties_disp, event->data.mouse.button, True, 0);
|
XTestFakeButtonEvent(properties_disp, event->data.mouse.button, True, 0);
|
||||||
}
|
} else if (event->type == EVENT_MOUSE_RELEASED) {
|
||||||
else if (event->type == EVENT_MOUSE_RELEASED) {
|
|
||||||
XTestFakeButtonEvent(properties_disp, event->data.mouse.button, False, 0);
|
XTestFakeButtonEvent(properties_disp, event->data.mouse.button, False, 0);
|
||||||
}
|
} else if (event->type == EVENT_MOUSE_CLICKED) {
|
||||||
else if (event->type == EVENT_MOUSE_CLICKED) {
|
|
||||||
XTestFakeButtonEvent(properties_disp, event->data.mouse.button, True, 0);
|
XTestFakeButtonEvent(properties_disp, event->data.mouse.button, True, 0);
|
||||||
XTestFakeButtonEvent(properties_disp, event->data.mouse.button, False, 0);
|
XTestFakeButtonEvent(properties_disp, event->data.mouse.button, False, 0);
|
||||||
}
|
}
|
||||||
@ -215,8 +208,7 @@ static inline void post_mouse_button_event(iohook_event * const event) {
|
|||||||
// type, amount and rotation
|
// type, amount and rotation
|
||||||
if (event->data.wheel.rotation < 0) {
|
if (event->data.wheel.rotation < 0) {
|
||||||
btn_event.button = WheelUp;
|
btn_event.button = WheelUp;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
btn_event.button = WheelDown;
|
btn_event.button = WheelDown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,7 @@ static inline void dispatch_event(iohook_event *const event) {
|
|||||||
__FUNCTION__, __LINE__, event->type);
|
__FUNCTION__, __LINE__, event->type);
|
||||||
|
|
||||||
dispatcher(event);
|
dispatcher(event);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: No dispatch callback set!\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: No dispatch callback set!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
@ -140,22 +139,19 @@ static void initialize_locks() {
|
|||||||
|
|
||||||
if (xkb_state_led_name_is_active(state, XKB_LED_NAME_CAPS)) {
|
if (xkb_state_led_name_is_active(state, XKB_LED_NAME_CAPS)) {
|
||||||
set_modifier_mask(MASK_CAPS_LOCK);
|
set_modifier_mask(MASK_CAPS_LOCK);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
unset_modifier_mask(MASK_CAPS_LOCK);
|
unset_modifier_mask(MASK_CAPS_LOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xkb_state_led_name_is_active(state, XKB_LED_NAME_NUM)) {
|
if (xkb_state_led_name_is_active(state, XKB_LED_NAME_NUM)) {
|
||||||
set_modifier_mask(MASK_NUM_LOCK);
|
set_modifier_mask(MASK_NUM_LOCK);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
unset_modifier_mask(MASK_NUM_LOCK);
|
unset_modifier_mask(MASK_NUM_LOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xkb_state_led_name_is_active(state, XKB_LED_NAME_SCROLL)) {
|
if (xkb_state_led_name_is_active(state, XKB_LED_NAME_SCROLL)) {
|
||||||
set_modifier_mask(MASK_SCROLL_LOCK);
|
set_modifier_mask(MASK_SCROLL_LOCK);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
unset_modifier_mask(MASK_SCROLL_LOCK);
|
unset_modifier_mask(MASK_SCROLL_LOCK);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -163,26 +159,22 @@ static void initialize_locks() {
|
|||||||
if (XkbGetIndicatorState(hook->ctrl.display, XkbUseCoreKbd, &led_mask) == Success) {
|
if (XkbGetIndicatorState(hook->ctrl.display, XkbUseCoreKbd, &led_mask) == Success) {
|
||||||
if (led_mask & 0x01) {
|
if (led_mask & 0x01) {
|
||||||
set_modifier_mask(MASK_CAPS_LOCK);
|
set_modifier_mask(MASK_CAPS_LOCK);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
unset_modifier_mask(MASK_CAPS_LOCK);
|
unset_modifier_mask(MASK_CAPS_LOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (led_mask & 0x02) {
|
if (led_mask & 0x02) {
|
||||||
set_modifier_mask(MASK_NUM_LOCK);
|
set_modifier_mask(MASK_NUM_LOCK);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
unset_modifier_mask(MASK_NUM_LOCK);
|
unset_modifier_mask(MASK_NUM_LOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (led_mask & 0x04) {
|
if (led_mask & 0x04) {
|
||||||
set_modifier_mask(MASK_SCROLL_LOCK);
|
set_modifier_mask(MASK_SCROLL_LOCK);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
unset_modifier_mask(MASK_SCROLL_LOCK);
|
unset_modifier_mask(MASK_SCROLL_LOCK);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: XkbGetIndicatorState failed to get current led mask!\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: XkbGetIndicatorState failed to get current led mask!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
@ -231,8 +223,7 @@ static void initialize_modifiers() {
|
|||||||
if (mask & Button3Mask) { set_modifier_mask(MASK_BUTTON3); }
|
if (mask & Button3Mask) { set_modifier_mask(MASK_BUTTON3); }
|
||||||
if (mask & Button4Mask) { set_modifier_mask(MASK_BUTTON4); }
|
if (mask & Button4Mask) { set_modifier_mask(MASK_BUTTON4); }
|
||||||
if (mask & Button5Mask) { set_modifier_mask(MASK_BUTTON5); }
|
if (mask & Button5Mask) { set_modifier_mask(MASK_BUTTON5); }
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: XQueryPointer failed to get current modifiers!\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: XQueryPointer failed to get current modifiers!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
@ -270,8 +261,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
|
|
||||||
// Fire the hook start event.
|
// Fire the hook start event.
|
||||||
dispatch_event(&event);
|
dispatch_event(&event);
|
||||||
}
|
} else if (recorded_data->category == XRecordEndOfData) {
|
||||||
else if (recorded_data->category == XRecordEndOfData) {
|
|
||||||
// Populate the hook stop event.
|
// Populate the hook stop event.
|
||||||
event.time = timestamp;
|
event.time = timestamp;
|
||||||
event.reserved = 0x00;
|
event.reserved = 0x00;
|
||||||
@ -281,8 +271,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
|
|
||||||
// Fire the hook stop event.
|
// Fire the hook stop event.
|
||||||
dispatch_event(&event);
|
dispatch_event(&event);
|
||||||
}
|
} else if (recorded_data->category == XRecordFromServer || recorded_data->category == XRecordFromClient) {
|
||||||
else if (recorded_data->category == XRecordFromServer || recorded_data->category == XRecordFromClient) {
|
|
||||||
// Get XRecord data.
|
// Get XRecord data.
|
||||||
XRecordDatum *data = (XRecordDatum *) recorded_data->data;
|
XRecordDatum *data = (XRecordDatum *) recorded_data->data;
|
||||||
|
|
||||||
@ -381,8 +370,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
dispatch_event(&event);
|
dispatch_event(&event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (data->type == KeyRelease) {
|
||||||
else if (data->type == KeyRelease) {
|
|
||||||
// The X11 KeyCode associated with this event.
|
// The X11 KeyCode associated with this event.
|
||||||
KeyCode keycode = (KeyCode) data->event.u.u.detail;
|
KeyCode keycode = (KeyCode) data->event.u.u.detail;
|
||||||
KeySym keysym = 0x00;
|
KeySym keysym = 0x00;
|
||||||
@ -442,8 +430,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
|
|
||||||
// Fire key released event.
|
// Fire key released event.
|
||||||
dispatch_event(&event);
|
dispatch_event(&event);
|
||||||
}
|
} else if (data->type == ButtonPress) {
|
||||||
else if (data->type == ButtonPress) {
|
|
||||||
// X11 handles wheel events as button events.
|
// X11 handles wheel events as button events.
|
||||||
if (data->event.u.u.detail == WheelUp || data->event.u.u.detail == WheelDown
|
if (data->event.u.u.detail == WheelUp || data->event.u.u.detail == WheelDown
|
||||||
|| data->event.u.u.detail == WheelLeft || data->event.u.u.detail == WheelRight) {
|
|| data->event.u.u.detail == WheelLeft || data->event.u.u.detail == WheelRight) {
|
||||||
@ -500,8 +487,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
if (data->event.u.u.detail == WheelUp || data->event.u.u.detail == WheelLeft) {
|
if (data->event.u.u.detail == WheelUp || data->event.u.u.detail == WheelLeft) {
|
||||||
// Wheel Rotated Up and Away.
|
// Wheel Rotated Up and Away.
|
||||||
event.data.wheel.rotation = -1;
|
event.data.wheel.rotation = -1;
|
||||||
}
|
} else { // data->event.u.u.detail == WheelDown
|
||||||
else { // data->event.u.u.detail == WheelDown
|
|
||||||
// Wheel Rotated Down and Towards.
|
// Wheel Rotated Down and Towards.
|
||||||
event.data.wheel.rotation = 1;
|
event.data.wheel.rotation = 1;
|
||||||
}
|
}
|
||||||
@ -509,8 +495,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
if (data->event.u.u.detail == WheelUp || data->event.u.u.detail == WheelDown) {
|
if (data->event.u.u.detail == WheelUp || data->event.u.u.detail == WheelDown) {
|
||||||
// Wheel Rotated Up or Down.
|
// Wheel Rotated Up or Down.
|
||||||
event.data.wheel.direction = WHEEL_VERTICAL_DIRECTION;
|
event.data.wheel.direction = WHEEL_VERTICAL_DIRECTION;
|
||||||
}
|
} else { // data->event.u.u.detail == WheelLeft || data->event.u.u.detail == WheelRight
|
||||||
else { // data->event.u.u.detail == WheelLeft || data->event.u.u.detail == WheelRight
|
|
||||||
// Wheel Rotated Left or Right.
|
// Wheel Rotated Left or Right.
|
||||||
event.data.wheel.direction = WHEEL_HORIZONTAL_DIRECTION;
|
event.data.wheel.direction = WHEEL_HORIZONTAL_DIRECTION;
|
||||||
}
|
}
|
||||||
@ -523,8 +508,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
|
|
||||||
// Fire mouse wheel event.
|
// Fire mouse wheel event.
|
||||||
dispatch_event(&event);
|
dispatch_event(&event);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/* This information is all static for X11, its up to the WM to
|
/* This information is all static for X11, its up to the WM to
|
||||||
* decide how to interpret the wheel events.
|
* decide how to interpret the wheel events.
|
||||||
*/
|
*/
|
||||||
@ -566,13 +550,11 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
if (button == hook->input.mouse.click.button && (long int) (timestamp - hook->input.mouse.click.time) <= hook_get_multi_click_time()) {
|
if (button == hook->input.mouse.click.button && (long int) (timestamp - hook->input.mouse.click.time) <= hook_get_multi_click_time()) {
|
||||||
if (hook->input.mouse.click.count < USHRT_MAX) {
|
if (hook->input.mouse.click.count < USHRT_MAX) {
|
||||||
hook->input.mouse.click.count++;
|
hook->input.mouse.click.count++;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: Click count overflow detected!\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: Click count overflow detected!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Reset the click count.
|
// Reset the click count.
|
||||||
hook->input.mouse.click.count = 1;
|
hook->input.mouse.click.count = 1;
|
||||||
|
|
||||||
@ -616,8 +598,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
// Fire mouse pressed event.
|
// Fire mouse pressed event.
|
||||||
dispatch_event(&event);
|
dispatch_event(&event);
|
||||||
}
|
}
|
||||||
}
|
} else if (data->type == ButtonRelease) {
|
||||||
else if (data->type == ButtonRelease) {
|
|
||||||
// X11 handles wheel events as button events.
|
// X11 handles wheel events as button events.
|
||||||
if (data->event.u.u.detail != WheelUp && data->event.u.u.detail != WheelDown) {
|
if (data->event.u.u.detail != WheelUp && data->event.u.u.detail != WheelDown) {
|
||||||
/* This information is all static for X11, its up to the WM to
|
/* This information is all static for X11, its up to the WM to
|
||||||
@ -731,8 +712,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
hook->input.mouse.click.count = 0;
|
hook->input.mouse.click.count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (data->type == MotionNotify) {
|
||||||
else if (data->type == MotionNotify) {
|
|
||||||
// Reset the click count.
|
// Reset the click count.
|
||||||
if (hook->input.mouse.click.count != 0 && (long int) (timestamp - hook->input.mouse.click.time) > hook_get_multi_click_time()) {
|
if (hook->input.mouse.click.count != 0 && (long int) (timestamp - hook->input.mouse.click.time) > hook_get_multi_click_time()) {
|
||||||
hook->input.mouse.click.count = 0;
|
hook->input.mouse.click.count = 0;
|
||||||
@ -750,8 +730,7 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
if (hook->input.mouse.is_dragged) {
|
if (hook->input.mouse.is_dragged) {
|
||||||
// Create Mouse Dragged event.
|
// Create Mouse Dragged event.
|
||||||
event.type = EVENT_MOUSE_DRAGGED;
|
event.type = EVENT_MOUSE_DRAGGED;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Create a Mouse Moved event.
|
// Create a Mouse Moved event.
|
||||||
event.type = EVENT_MOUSE_MOVED;
|
event.type = EVENT_MOUSE_MOVED;
|
||||||
}
|
}
|
||||||
@ -780,14 +759,12 @@ void hook_event_proc(XPointer closeure, XRecordInterceptData *recorded_data) {
|
|||||||
|
|
||||||
// Fire mouse move event.
|
// Fire mouse move event.
|
||||||
dispatch_event(&event);
|
dispatch_event(&event);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// In theory this *should* never execute.
|
// In theory this *should* never execute.
|
||||||
logger(LOG_LEVEL_DEBUG, "%s [%u]: Unhandled X11 event: %#X.\n",
|
logger(LOG_LEVEL_DEBUG, "%s [%u]: Unhandled X11 event: %#X.\n",
|
||||||
__FUNCTION__, __LINE__, (unsigned int) data->type);
|
__FUNCTION__, __LINE__, (unsigned int) data->type);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: Unhandled X11 hook category! (%#X)\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: Unhandled X11 hook category! (%#X)\n",
|
||||||
__FUNCTION__, __LINE__, recorded_data->category);
|
__FUNCTION__, __LINE__, recorded_data->category);
|
||||||
}
|
}
|
||||||
@ -917,8 +894,7 @@ static int xrecord_alloc() {
|
|||||||
|
|
||||||
// Free up the context if it was set.
|
// Free up the context if it was set.
|
||||||
XRecordFreeContext(hook->data.display, hook->ctrl.context);
|
XRecordFreeContext(hook->data.display, hook->ctrl.context);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: XRecordCreateContext failure!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: XRecordCreateContext failure!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
@ -928,8 +904,7 @@ static int xrecord_alloc() {
|
|||||||
|
|
||||||
// Free the XRecord range.
|
// Free the XRecord range.
|
||||||
XFree(hook->data.range);
|
XFree(hook->data.range);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: XRecordAllocRange failure!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: XRecordAllocRange failure!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
@ -950,8 +925,7 @@ static int xrecord_query() {
|
|||||||
__FUNCTION__, __LINE__, major, minor);
|
__FUNCTION__, __LINE__, major, minor);
|
||||||
|
|
||||||
status = xrecord_alloc();
|
status = xrecord_alloc();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: XRecord is not currently available!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: XRecord is not currently available!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
@ -978,8 +952,7 @@ static int xrecord_start() {
|
|||||||
if (is_auto_repeat) {
|
if (is_auto_repeat) {
|
||||||
logger(LOG_LEVEL_DEBUG, "%s [%u]: Successfully enabled detectable autorepeat.\n",
|
logger(LOG_LEVEL_DEBUG, "%s [%u]: Successfully enabled detectable autorepeat.\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: Could not enable detectable auto-repeat!\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: Could not enable detectable auto-repeat!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
@ -994,13 +967,11 @@ static int xrecord_start() {
|
|||||||
|
|
||||||
if (context != NULL) {
|
if (context != NULL) {
|
||||||
hook->input.context = xkb_context_ref(context);
|
hook->input.context = xkb_context_ref(context);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: xkb_context_new failure!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: xkb_context_new failure!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: xcb_connect failure! (%d)\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: xcb_connect failure! (%d)\n",
|
||||||
__FUNCTION__, __LINE__, xcb_status);
|
__FUNCTION__, __LINE__, xcb_status);
|
||||||
}
|
}
|
||||||
@ -1030,8 +1001,7 @@ static int xrecord_start() {
|
|||||||
hook->input.connection = NULL;
|
hook->input.connection = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: XOpenDisplay failure!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: XOpenDisplay failure!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
@ -1070,8 +1040,7 @@ IOHOOK_API int hook_run() {
|
|||||||
// Free data associated with this hook.
|
// Free data associated with this hook.
|
||||||
free(hook);
|
free(hook);
|
||||||
hook = NULL;
|
hook = NULL;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: Failed to allocate memory for hook structure!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: Failed to allocate memory for hook structure!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
@ -1112,8 +1081,7 @@ IOHOOK_API int hook_stop() {
|
|||||||
|
|
||||||
status = IOHOOK_SUCCESS;
|
status = IOHOOK_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: XRecordGetContext failure!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: XRecordGetContext failure!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
@ -1121,8 +1089,7 @@ IOHOOK_API int hook_stop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
free(state);
|
free(state);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: Failed to allocate memory for XRecordState!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: Failed to allocate memory for XRecordState!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
|
||||||
|
@ -1465,11 +1465,9 @@ KeySym unicode_to_keysym(uint16_t unicode) {
|
|||||||
mid = (min + max) / 2;
|
mid = (min + max) / 2;
|
||||||
if (keysym_unicode_table[mid].unicode < unicode) {
|
if (keysym_unicode_table[mid].unicode < unicode) {
|
||||||
min = mid + 1;
|
min = mid + 1;
|
||||||
}
|
} else if (keysym_unicode_table[mid].unicode > unicode) {
|
||||||
else if (keysym_unicode_table[mid].unicode > unicode) {
|
|
||||||
max = mid - 1;
|
max = mid - 1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Found it.
|
// Found it.
|
||||||
return keysym_unicode_table[mid].keysym;
|
return keysym_unicode_table[mid].keysym;
|
||||||
}
|
}
|
||||||
@ -1535,11 +1533,9 @@ size_t keysym_to_unicode(KeySym keysym, uint16_t *buffer, size_t size) {
|
|||||||
mid = (min + max) / 2;
|
mid = (min + max) / 2;
|
||||||
if (keysym_unicode_table[mid].keysym < keysym) {
|
if (keysym_unicode_table[mid].keysym < keysym) {
|
||||||
min = mid + 1;
|
min = mid + 1;
|
||||||
}
|
} else if (keysym_unicode_table[mid].keysym > keysym) {
|
||||||
else if (keysym_unicode_table[mid].keysym > keysym) {
|
|
||||||
max = mid - 1;
|
max = mid - 1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Found it.
|
// Found it.
|
||||||
if (count < size) {
|
if (count < size) {
|
||||||
buffer[count++] = keysym_unicode_table[mid].unicode;
|
buffer[count++] = keysym_unicode_table[mid].unicode;
|
||||||
@ -1577,8 +1573,7 @@ uint16_t keycode_to_scancode(KeyCode keycode) {
|
|||||||
// extra space in the lookup table due to binary padding.
|
// extra space in the lookup table due to binary padding.
|
||||||
scancode = evdev_scancode_table[keycode][0];
|
scancode = evdev_scancode_table[keycode][0];
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Evdev was disabled, fallback to XFree86.
|
// Evdev was disabled, fallback to XFree86.
|
||||||
#endif
|
#endif
|
||||||
unsigned short xfree86_size = sizeof(xfree86_scancode_table) / sizeof(xfree86_scancode_table[0]);
|
unsigned short xfree86_size = sizeof(xfree86_scancode_table) / sizeof(xfree86_scancode_table[0]);
|
||||||
@ -1611,8 +1606,7 @@ KeyCode scancode_to_keycode(uint16_t scancode) {
|
|||||||
// but math is generally slower than memory and we cannot save any
|
// but math is generally slower than memory and we cannot save any
|
||||||
// extra space in the lookup table due to binary padding.
|
// extra space in the lookup table due to binary padding.
|
||||||
keycode = evdev_scancode_table[scancode][1];
|
keycode = evdev_scancode_table[scancode][1];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Offset is the lower order bits + 128
|
// Offset is the lower order bits + 128
|
||||||
scancode = (scancode & 0x007F) | 0x80;
|
scancode = (scancode & 0x007F) | 0x80;
|
||||||
|
|
||||||
@ -1620,8 +1614,7 @@ KeyCode scancode_to_keycode(uint16_t scancode) {
|
|||||||
keycode = evdev_scancode_table[scancode][1];
|
keycode = evdev_scancode_table[scancode][1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Evdev was disabled, fallback to XFree86.
|
// Evdev was disabled, fallback to XFree86.
|
||||||
#endif
|
#endif
|
||||||
unsigned short xfree86_size = sizeof(xfree86_scancode_table) / sizeof(xfree86_scancode_table[0]);
|
unsigned short xfree86_size = sizeof(xfree86_scancode_table) / sizeof(xfree86_scancode_table[0]);
|
||||||
@ -1632,8 +1625,7 @@ KeyCode scancode_to_keycode(uint16_t scancode) {
|
|||||||
// but math is generally slower than memory and we cannot save any
|
// but math is generally slower than memory and we cannot save any
|
||||||
// extra space in the lookup table due to binary padding.
|
// extra space in the lookup table due to binary padding.
|
||||||
keycode = xfree86_scancode_table[scancode][1];
|
keycode = xfree86_scancode_table[scancode][1];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Offset: lower order bits + 128 (If no size optimization!)
|
// Offset: lower order bits + 128 (If no size optimization!)
|
||||||
scancode = (scancode & 0x007F) | 0x80;
|
scancode = (scancode & 0x007F) | 0x80;
|
||||||
|
|
||||||
@ -1687,8 +1679,7 @@ size_t keycode_to_unicode(struct xkb_state* state, KeyCode keycode, uint16_t *bu
|
|||||||
if ((unicode <= 0xD7FF || (unicode >= 0xE000 && unicode <= 0xFFFF)) && length >= 1) {
|
if ((unicode <= 0xD7FF || (unicode >= 0xE000 && unicode <= 0xFFFF)) && length >= 1) {
|
||||||
buffer[0] = unicode;
|
buffer[0] = unicode;
|
||||||
count = 1;
|
count = 1;
|
||||||
}
|
} else if (unicode >= 0x10000) {
|
||||||
else if (unicode >= 0x10000) {
|
|
||||||
unsigned int code = (unicode - 0x10000);
|
unsigned int code = (unicode - 0x10000);
|
||||||
buffer[0] = 0xD800 | (code >> 10);
|
buffer[0] = 0xD800 | (code >> 10);
|
||||||
buffer[1] = 0xDC00 | (code & 0x3FF);
|
buffer[1] = 0xDC00 | (code & 0x3FF);
|
||||||
@ -1789,20 +1780,17 @@ KeySym keycode_to_keysym(KeyCode keycode, unsigned int modifier_mask) {
|
|||||||
if (modifier_mask & ShiftMask || (modifier_mask & LockMask && is_shift_lock)) {
|
if (modifier_mask & ShiftMask || (modifier_mask & LockMask && is_shift_lock)) {
|
||||||
// i = 0
|
// i = 0
|
||||||
keysym = keyboard_map[keycode *keysym_per_keycode];
|
keysym = keyboard_map[keycode *keysym_per_keycode];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// i = 1
|
// i = 1
|
||||||
keysym = keyboard_map[keycode *keysym_per_keycode + 1];
|
keysym = keyboard_map[keycode *keysym_per_keycode + 1];
|
||||||
}
|
}
|
||||||
}
|
} else if (modifier_mask ^ ShiftMask && modifier_mask ^ LockMask) {
|
||||||
else if (modifier_mask ^ ShiftMask && modifier_mask ^ LockMask) {
|
|
||||||
/* The Shift and Lock modifiers are both off. In this case,
|
/* The Shift and Lock modifiers are both off. In this case,
|
||||||
* the first KeySym is used.
|
* the first KeySym is used.
|
||||||
*/
|
*/
|
||||||
// index = 0
|
// index = 0
|
||||||
keysym = keyboard_map[keycode *keysym_per_keycode];
|
keysym = keyboard_map[keycode *keysym_per_keycode];
|
||||||
}
|
} else if (modifier_mask ^ ShiftMask && modifier_mask & LockMask && is_caps_lock) {
|
||||||
else if (modifier_mask ^ ShiftMask && modifier_mask & LockMask && is_caps_lock) {
|
|
||||||
/* The Shift modifier is off, and the Lock modifier is on
|
/* The Shift modifier is off, and the Lock modifier is on
|
||||||
* and is interpreted as CapsLock. In this case, the first
|
* and is interpreted as CapsLock. In this case, the first
|
||||||
* KeySym is used, but if that KeySym is lowercase
|
* KeySym is used, but if that KeySym is lowercase
|
||||||
@ -1818,8 +1806,7 @@ KeySym keycode_to_keysym(KeyCode keycode, unsigned int modifier_mask) {
|
|||||||
XConvertCase(keysym, &lower_keysym, &upper_keysym);
|
XConvertCase(keysym, &lower_keysym, &upper_keysym);
|
||||||
keysym = upper_keysym;
|
keysym = upper_keysym;
|
||||||
}
|
}
|
||||||
}
|
} else if (modifier_mask & ShiftMask && modifier_mask & LockMask && is_caps_lock) {
|
||||||
else if (modifier_mask & ShiftMask && modifier_mask & LockMask && is_caps_lock) {
|
|
||||||
/* The Shift modifier is on, and the Lock modifier is on and
|
/* The Shift modifier is on, and the Lock modifier is on and
|
||||||
* is interpreted as CapsLock. In this case, the second
|
* is interpreted as CapsLock. In this case, the second
|
||||||
* KeySym is used, but if that KeySym is lowercase
|
* KeySym is used, but if that KeySym is lowercase
|
||||||
@ -1835,16 +1822,14 @@ KeySym keycode_to_keysym(KeyCode keycode, unsigned int modifier_mask) {
|
|||||||
XConvertCase(keysym, &lower_keysym, &upper_keysym);
|
XConvertCase(keysym, &lower_keysym, &upper_keysym);
|
||||||
keysym = lower_keysym;
|
keysym = lower_keysym;
|
||||||
}
|
}
|
||||||
}
|
} else if (modifier_mask & ShiftMask || (modifier_mask & LockMask && is_shift_lock) || modifier_mask & (ShiftMask + LockMask)) {
|
||||||
else if (modifier_mask & ShiftMask || (modifier_mask & LockMask && is_shift_lock) || modifier_mask & (ShiftMask + LockMask)) {
|
|
||||||
/* The Shift modifier is on, or the Lock modifier is on and
|
/* The Shift modifier is on, or the Lock modifier is on and
|
||||||
* is interpreted as ShiftLock, or both. In this case, the
|
* is interpreted as ShiftLock, or both. In this case, the
|
||||||
* second KeySym is used.
|
* second KeySym is used.
|
||||||
*/
|
*/
|
||||||
// index = 1
|
// index = 1
|
||||||
keysym = keyboard_map[keycode *keysym_per_keycode + 1];
|
keysym = keyboard_map[keycode *keysym_per_keycode + 1];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: Unable to determine the KeySym index!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: Unable to determine the KeySym index!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
@ -1885,16 +1870,14 @@ void load_input_helper(Display *disp) {
|
|||||||
// logger(LOG_LEVEL_WARN,
|
// logger(LOG_LEVEL_WARN,
|
||||||
// "%s [%u]: Unknown keycode name '%s', please file a bug report!\n",
|
// "%s [%u]: Unknown keycode name '%s', please file a bug report!\n",
|
||||||
// __FUNCTION__, __LINE__, layout_name);
|
// __FUNCTION__, __LINE__, layout_name);
|
||||||
}
|
} else if (layout_name == NULL) {
|
||||||
else if (layout_name == NULL) {
|
|
||||||
logger(LOG_LEVEL_ERROR,
|
logger(LOG_LEVEL_ERROR,
|
||||||
"%s [%u]: X atom name failure for desc->names->keycodes!\n",
|
"%s [%u]: X atom name failure for desc->names->keycodes!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
XkbFreeClientMap(desc, XkbGBN_AllComponentsMask, True);
|
XkbFreeClientMap(desc, XkbGBN_AllComponentsMask, True);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_WARN,
|
logger(LOG_LEVEL_WARN,
|
||||||
"%s [%u]: XkbGetKeyboard failed to locate a valid keyboard!\n",
|
"%s [%u]: XkbGetKeyboard failed to locate a valid keyboard!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
@ -1940,23 +1923,20 @@ void load_input_helper(Display *disp) {
|
|||||||
if (capsLock != 0 && modifierMap->modifiermap[i] == capsLock) {
|
if (capsLock != 0 && modifierMap->modifiermap[i] == capsLock) {
|
||||||
is_caps_lock = true;
|
is_caps_lock = true;
|
||||||
is_shift_lock = false;
|
is_shift_lock = false;
|
||||||
}
|
} else if (shiftLock != 0 && modifierMap->modifiermap[i] == shiftLock) {
|
||||||
else if (shiftLock != 0 && modifierMap->modifiermap[i] == shiftLock) {
|
|
||||||
is_shift_lock = true;
|
is_shift_lock = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XFree(modifierMap);
|
XFree(modifierMap);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
XFree(keyboard_map);
|
XFree(keyboard_map);
|
||||||
|
|
||||||
logger(LOG_LEVEL_ERROR,
|
logger(LOG_LEVEL_ERROR,
|
||||||
"%s [%u]: Unable to get modifier mapping table!\n",
|
"%s [%u]: Unable to get modifier mapping table!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR,
|
logger(LOG_LEVEL_ERROR,
|
||||||
"%s [%u]: Unable to get keyboard mapping table!\n",
|
"%s [%u]: Unable to get keyboard mapping table!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
|
@ -95,8 +95,7 @@ static void *settings_thread_proc(void *arg) {
|
|||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&xrandr_mutex);
|
pthread_mutex_unlock(&xrandr_mutex);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: XRandR is not currently available!\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: XRandR is not currently available!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
@ -106,8 +105,7 @@ static void *settings_thread_proc(void *arg) {
|
|||||||
// Execute the thread cleanup handler.
|
// Execute the thread cleanup handler.
|
||||||
pthread_cleanup_pop(1);
|
pthread_cleanup_pop(1);
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: XOpenDisplay failure!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: XOpenDisplay failure!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
@ -131,8 +129,7 @@ IOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) {
|
|||||||
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: Screen count overflow detected!\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: Screen count overflow detected!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
*count = (uint8_t) xine_count;
|
*count = (uint8_t) xine_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,8 +160,7 @@ IOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) {
|
|||||||
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: Screen count overflow detected!\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: Screen count overflow detected!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
*count = (uint8_t) xrandr_count;
|
*count = (uint8_t) xrandr_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,8 +181,7 @@ IOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
XRRFreeCrtcInfo(crtc_info);
|
XRRFreeCrtcInfo(crtc_info);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: XRandr failed to return crtc information! (%#X)\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: XRandr failed to return crtc information! (%#X)\n",
|
||||||
__FUNCTION__, __LINE__, xrandr_resources->crtcs[i]);
|
__FUNCTION__, __LINE__, xrandr_resources->crtcs[i]);
|
||||||
}
|
}
|
||||||
@ -249,8 +244,7 @@ IOHOOK_API long int hook_get_auto_repeat_rate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
||||||
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
||||||
}
|
}
|
||||||
@ -295,8 +289,7 @@ IOHOOK_API long int hook_get_auto_repeat_delay() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
||||||
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
||||||
}
|
}
|
||||||
@ -321,8 +314,7 @@ IOHOOK_API long int hook_get_pointer_acceleration_multiplier() {
|
|||||||
|
|
||||||
value = (long int) accel_denominator;
|
value = (long int) accel_denominator;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
||||||
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
||||||
}
|
}
|
||||||
@ -343,8 +335,7 @@ IOHOOK_API long int hook_get_pointer_acceleration_threshold() {
|
|||||||
|
|
||||||
value = (long int) threshold;
|
value = (long int) threshold;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
||||||
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
||||||
}
|
}
|
||||||
@ -365,8 +356,7 @@ IOHOOK_API long int hook_get_pointer_sensitivity() {
|
|||||||
|
|
||||||
value = (long int) accel_numerator;
|
value = (long int) accel_numerator;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
||||||
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
||||||
}
|
}
|
||||||
@ -393,8 +383,7 @@ IOHOOK_API long int hook_get_multi_click_time() {
|
|||||||
successful = true;
|
successful = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
||||||
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
||||||
}
|
}
|
||||||
@ -422,8 +411,7 @@ IOHOOK_API long int hook_get_multi_click_time() {
|
|||||||
successful = true;
|
successful = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: %s\n",
|
||||||
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
||||||
}
|
}
|
||||||
@ -446,8 +434,7 @@ void on_library_load() {
|
|||||||
if (properties_disp == NULL) {
|
if (properties_disp == NULL) {
|
||||||
logger(LOG_LEVEL_WARN, "%s [%u]: %s\n",
|
logger(LOG_LEVEL_WARN, "%s [%u]: %s\n",
|
||||||
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
__FUNCTION__, __LINE__, "XOpenDisplay failure!");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_DEBUG, "%s [%u]: %s\n",
|
logger(LOG_LEVEL_DEBUG, "%s [%u]: %s\n",
|
||||||
__FUNCTION__, __LINE__, "XOpenDisplay success.");
|
__FUNCTION__, __LINE__, "XOpenDisplay success.");
|
||||||
}
|
}
|
||||||
@ -461,8 +448,7 @@ void on_library_load() {
|
|||||||
if (pthread_create(&settings_thread_id, &settings_thread_attr, settings_thread_proc, NULL) == 0) {
|
if (pthread_create(&settings_thread_id, &settings_thread_attr, settings_thread_proc, NULL) == 0) {
|
||||||
logger(LOG_LEVEL_DEBUG, "%s [%u]: Successfully created settings thread.\n",
|
logger(LOG_LEVEL_DEBUG, "%s [%u]: Successfully created settings thread.\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
logger(LOG_LEVEL_ERROR, "%s [%u]: Failed to create settings thread!\n",
|
logger(LOG_LEVEL_ERROR, "%s [%u]: Failed to create settings thread!\n",
|
||||||
__FUNCTION__, __LINE__);
|
__FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user