diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 15664606a..e1c909b21 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -40,7 +40,11 @@
#include
#include "meta-accel-parse.h"
+#ifdef __linux__
#include
+#elif !defined KEY_GRAVE
+#define KEY_GRAVE 0x29 /* assume the use of xf86-input-keyboard */
+#endif
#include "backends/x11/meta-backend-x11.h"
#include "x11/window-x11.h"