From 35b12c796971fa5afd9ffeb393c365973c76237f Mon Sep 17 00:00:00 2001
From: Dylan Araps <dylan.araps@gmail.com>
Date: Thu, 24 Oct 2019 23:33:41 +0300
Subject: [PATCH] sowm: swap to new keycode to keysym func

---
 Makefile | 2 +-
 sowm.c   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 3154a2f..8573837 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CFLAGS+= -std=c99 -Wall -Wextra -pedantic -Wno-deprecated-declarations
+CFLAGS+= -std=c99 -Wall -Wextra -pedantic
 LDADD+= -lX11
 LDFLAGS=
 PREFIX?= /usr
diff --git a/sowm.c b/sowm.c
index e77dcf8..d1b4c2a 100644
--- a/sowm.c
+++ b/sowm.c
@@ -3,6 +3,7 @@
 #include <X11/Xlib.h>
 #include <X11/XF86keysym.h>
 #include <X11/keysym.h>
+#include <X11/XKBlib.h>
 #include <stdlib.h>
 #include <signal.h>
 #include <unistd.h>
@@ -107,7 +108,7 @@ void notify_motion(XEvent *e) {
 }
 
 void key_press(XEvent *e) {
-    KeySym keysym = XKeycodeToKeysym(d, e->xkey.keycode, 0);
+    KeySym keysym = XkbKeycodeToKeysym(d, e->xkey.keycode, 0, 0);
 
     for (unsigned int i=0; i < sizeof(keys)/sizeof(*keys); ++i)
         if (keys[i].mod == e->xkey.state && keys[i].keysym == keysym)