From 119b623640254f425a89a3f13ce5cbe633ead9c2 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 1 Feb 2024 14:09:26 +0100 Subject: Support for keycode input --- xutil.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xutil.cpp') diff --git a/xutil.cpp b/xutil.cpp index 7adceaa..2651dba 100644 --- a/xutil.cpp +++ b/xutil.cpp @@ -49,8 +49,11 @@ namespace x { } void globalKeyWatch(Display *dpy, Keysym keysym, std::function callback) { + globalKeyWatch(dpy, keysym.toCode(dpy), callback); + } + + void globalKeyWatch(Display *dpy, Keycode keycode, std::function callback) { const Window root = DefaultRootWindow(dpy); - const Keycode keycode = keysym.toCode(dpy); auto guard = XGrabKeyRAII(dpy, keycode, AnyModifier, root); -- cgit v1.2.3-70-g09d2