From deb5b378250069b9da1348f74b46b19a80b66f3d Mon Sep 17 00:00:00 2001 From: Kacper Kasper Date: Wed, 29 Aug 2018 08:08:42 +1000 Subject: Backport: Allow read access to the key map. Required on Haiku to set up key bindings that include the Cmd modifier. Backport of changeset 7077:1593328120e5. --- src/KeyMap.cxx | 4 ++++ src/KeyMap.h | 1 + 2 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/KeyMap.cxx b/src/KeyMap.cxx index 7587ef03f..42982b4f7 100644 --- a/src/KeyMap.cxx +++ b/src/KeyMap.cxx @@ -45,6 +45,10 @@ unsigned int KeyMap::Find(int key, int modifiers) const { return (it == kmap.end()) ? 0 : it->second; } +const std::map &KeyMap::GetKeyMap() const { + return kmap; +} + #if PLAT_GTK_MACOSX #define OS_X_KEYS 1 #else diff --git a/src/KeyMap.h b/src/KeyMap.h index 08f6c4ef7..b4299feec 100644 --- a/src/KeyMap.h +++ b/src/KeyMap.h @@ -56,6 +56,7 @@ public: void Clear(); void AssignCmdKey(int key, int modifiers, unsigned int msg); unsigned int Find(int key, int modifiers) const; // 0 returned on failure + const std::map &GetKeyMap() const; }; } -- cgit v1.2.3