Skip to content

Commit

Permalink
Changing input_helper, input_hook and system_properties logging to be…
Browse files Browse the repository at this point in the history
… less verbose.
  • Loading branch information
kwhat committed Sep 24, 2021
1 parent b18e376 commit 8e23b27
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/darwin/system_properties.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ UIOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) {
}
}
} else {
logger(LOG_LEVEL_DEBUG, "%s [%u]: multiple_get_screen_info failed: %ld. Fallback.\n",
logger(LOG_LEVEL_WARN, "%s [%u]: multiple_get_screen_info failed: %ld. Fallback.\n",
__FUNCTION__, __LINE__, status);

size_t width = CGDisplayPixelsWide(CGMainDisplayID());
Expand Down
2 changes: 1 addition & 1 deletion src/windows/input_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ SIZE_T keycode_to_unicode(DWORD keycode, PWCHAR buffer, SIZE_T size) {

// Check and make sure the Unicode helper was loaded.
if (locale_current != NULL) {
logger(LOG_LEVEL_INFO,
logger(LOG_LEVEL_DEBUG,
"%s [%u]: Using keyboard layout %#p.\n",
__FUNCTION__, __LINE__, locale_current->id);

Expand Down
2 changes: 1 addition & 1 deletion src/windows/input_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ LRESULT CALLBACK mouse_hook_event_proc(int nCode, WPARAM wParam, LPARAM lParam)
void CALLBACK win_hook_event_proc(HWINEVENTHOOK hook, DWORD event, HWND hWnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime) {
switch (event) {
case EVENT_OBJECT_NAMECHANGE:
logger(LOG_LEVEL_INFO, "%s [%u]: Restarting Windows input hook on window event: %#X.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: Restarting Windows input hook on window event: %#X.\n",
__FUNCTION__, __LINE__, event);

// Remove any keyboard or mouse hooks that are still running.
Expand Down
18 changes: 9 additions & 9 deletions src/windows/system_properties.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static BOOL CALLBACK monitor_enum_proc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT
.height = height
};

logger(LOG_LEVEL_INFO, "%s [%u]: Monitor %d: %ldx%ld (%ld, %ld)\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: Monitor %d: %ldx%ld (%ld, %ld)\n",
__FUNCTION__, __LINE__, screens->count, width, height, origin_x, origin_y);
}

Expand All @@ -92,7 +92,7 @@ UIOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) {

if (!status || screens.count == 0) {
// Fallback in case EnumDisplayMonitors fails.
logger(LOG_LEVEL_INFO, "%s [%u]: EnumDisplayMonitors failed. Fallback.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: EnumDisplayMonitors failed. Fallback.\n",
__FUNCTION__, __LINE__);

int width = GetSystemMetrics(SM_CXSCREEN);
Expand Down Expand Up @@ -125,7 +125,7 @@ UIOHOOK_API long int hook_get_auto_repeat_rate() {
long int rate;

if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &rate, 0)) {
logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETKEYBOARDSPEED: %li.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETKEYBOARDSPEED: %li.\n",
__FUNCTION__, __LINE__, rate);

value = rate;
Expand All @@ -139,7 +139,7 @@ UIOHOOK_API long int hook_get_auto_repeat_delay() {
long int delay;

if (SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &delay, 0)) {
logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETKEYBOARDDELAY: %li.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETKEYBOARDDELAY: %li.\n",
__FUNCTION__, __LINE__, delay);

value = delay;
Expand All @@ -153,7 +153,7 @@ UIOHOOK_API long int hook_get_pointer_acceleration_multiplier() {
int mouse[3]; // 0-Threshold X, 1-Threshold Y and 2-Speed.

if (SystemParametersInfo(SPI_GETMOUSE, 0, &mouse, 0)) {
logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETMOUSE[2]: %i.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETMOUSE[2]: %i.\n",
__FUNCTION__, __LINE__, mouse[2]);

value = mouse[2];
Expand All @@ -167,9 +167,9 @@ UIOHOOK_API long int hook_get_pointer_acceleration_threshold() {
int mouse[3]; // 0-Threshold X, 1-Threshold Y and 2-Speed.

if (SystemParametersInfo(SPI_GETMOUSE, 0, &mouse, 0)) {
logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETMOUSE[0]: %i.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETMOUSE[0]: %i.\n",
__FUNCTION__, __LINE__, mouse[0]);
logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETMOUSE[1]: %i.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETMOUSE[1]: %i.\n",
__FUNCTION__, __LINE__, mouse[1]);

// Average the x and y thresholds.
Expand All @@ -184,7 +184,7 @@ UIOHOOK_API long int hook_get_pointer_sensitivity() {
int sensitivity;

if (SystemParametersInfo(SPI_GETMOUSESPEED, 0, &sensitivity, 0)) {
logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETMOUSESPEED: %i.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETMOUSESPEED: %i.\n",
__FUNCTION__, __LINE__, sensitivity);

value = sensitivity;
Expand All @@ -198,7 +198,7 @@ UIOHOOK_API long int hook_get_multi_click_time() {
UINT clicktime;

clicktime = GetDoubleClickTime();
logger(LOG_LEVEL_INFO, "%s [%u]: GetDoubleClickTime: %u.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: GetDoubleClickTime: %u.\n",
__FUNCTION__, __LINE__, (unsigned int) clicktime);

value = (long int) clicktime;
Expand Down
2 changes: 1 addition & 1 deletion src/x11/input_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ static int xrecord_query() {
// Check to make sure XRecord is installed and enabled.
int major, minor;
if (XRecordQueryVersion(hook->ctrl.display, &major, &minor) != 0) {
logger(LOG_LEVEL_INFO, "%s [%u]: XRecord version: %i.%i.\n",
logger(LOG_LEVEL_DEBUG, "%s [%u]: XRecord version: %i.%i.\n",
__FUNCTION__, __LINE__, major, minor);

status = xrecord_alloc();
Expand Down

0 comments on commit 8e23b27

Please sign in to comment.