Files
ckb-next/src/ckbnextconfig.h.in
T
Karl Fleischmann 46f2f08e76 daemon, gui: Consolidate keyname length in project
This commit fixes incorrect behavior of the 'w' key which was linked to
the "ctrlwheelcw" event, because the keyname was read in 10 character
chunks.

Create a consolidated macro, with a large enough limit to allow all
currently relevant keys. Replace all custom keyname lengths with this
macro. Ensure that relevant sscanf() calls use an appropriate string
version of this length (minus one for the trailing '\0').

CKB_KEYNAME_MAX in animation.h still needs to be kept in sync manually
due to it being a standalone header.
2026-05-22 17:51:42 +03:00

30 lines
1.1 KiB
C

#define CKB_NEXT_VERSION_STR "${ckb-next_VERSION}"
#define CKB_NEXT_ANIMATIONS_PATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_DIR_ANIMATIONS}"
#define CKB_NEXT_UTILITIES_PATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_DIR_UTILITIES}"
#define CKB_NEXT_PROFILE_VER ${ckb-next_PROFILE_VER}
#define CKB_NEXT_SETTINGS_VER ${ckb-next_SETTINGS_VER}
#cmakedefine DISABLE_UPDATER
#cmakedefine DEBUG_USB_SEND
#cmakedefine DEBUG_USB_RECV
#cmakedefine DEBUG_USB_INPUT
#cmakedefine DEBUG_MUTEX
#cmakedefine NO_FAIR_MUTEX_QUEUEING
#cmakedefine DEBUG_INPUT_SYNC
#cmakedefine FPS_COUNTER
#define CKB_NEXT_COPYRIGHT_YEAR "${ckb-next_COPYRIGHT_YEAR}"
#cmakedefine ckb_next_VERSION_IS_RELEASE
#define CKB_NEXT_DESCRIPTION "Open Source Driver for Corsair devices."
#include <assert.h>
// Number of characters allowed for key names.
#define N_KEYNAME_LENGTH 40
#define N_KEYNAME_STRLEN 39
#define N_KEYNAME_STR_REAL(x) #x
#define N_KEYNAME_STR(x) N_KEYNAME_STR_REAL(x)
#define N_SCANF_KEYNAME N_KEYNAME_STR(N_KEYNAME_STRLEN)
static_assert((N_KEYNAME_LENGTH == N_KEYNAME_STRLEN + 1), "N_KEYNAME_LENGTH must be 1 greater than N_KEYNAME_STRLEN");