summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xkbcommon/xkbcommon.h6
-rw-r--r--src/state.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index 185d11b..4eeaaca 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -423,6 +423,12 @@ xkb_state_ref(struct xkb_state *state);
void
xkb_state_unref(struct xkb_state *state);
+/**
+ * Get the keymap from which the state object was created.
+ */
+struct xkb_keymap *
+xkb_state_get_map(struct xkb_state *state);
+
enum xkb_key_direction {
XKB_KEY_UP,
XKB_KEY_DOWN,
diff --git a/src/state.c b/src/state.c
index 45820b6..8394050 100644
--- a/src/state.c
+++ b/src/state.c
@@ -494,6 +494,12 @@ xkb_state_unref(struct xkb_state *state)
free(state);
}
+_X_EXPORT struct xkb_keymap *
+xkb_state_get_map(struct xkb_state *state)
+{
+ return state->xkb;
+}
+
/**
* Update the LED state to match the rest of the xkb_state.
*/