Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-07-03 16:07:46 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-07-03 16:55:22 +0300
commit947cdb3acd296d8e2e849586d5a41cc0d0dcb28c (patch)
tree36eb74d8f0185c747e50dc21c7087420d83afa47 /source/blender/windowmanager/WM_keymap.h
parent36426c3ee2d957c1898555f51ec828b31c5f746c (diff)
UI: add ability to access/generate 'shortcuts strings' of modal keymaps.
We already had that for global keymaps (used e.g. to generate shortcuts for menu entries), but this wasn’t possible for modal keymaps yet (e.g. help message in header during transforms and other modal operation). This commit only adds needing background code, it does not change anything from user PoV. Modal operators will be updated to use it in comming weeks. Thanks to Campbell for revisions & suggestions. :) Differential Revision: https://developer.blender.org/D780
Diffstat (limited to 'source/blender/windowmanager/WM_keymap.h')
-rw-r--r--source/blender/windowmanager/WM_keymap.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h
index fdde28c6bf1..987cbb4234c 100644
--- a/source/blender/windowmanager/WM_keymap.h
+++ b/source/blender/windowmanager/WM_keymap.h
@@ -68,7 +68,7 @@ wmKeyMapItem *WM_keymap_add_menu_pie(struct wmKeyMap *keymap, const char *idname
int val, int modifier, int keymodifier);
bool WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
-int WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, const int len);
+int WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, const int len, const bool compact);
wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid);
wmKeyMap *WM_keymap_find(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid);
@@ -82,6 +82,12 @@ int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2);
/* Modal Keymap */
+int WM_modalkeymap_operator_items_to_string(struct wmOperatorType *ot, const int propvalue,
+ char *str, const int len, const bool compact);
+char *WM_modalkeymap_operator_items_to_string_buf(
+ struct wmOperatorType *ot, const int propvalue,
+ char **str, int *available_len, const int max_len, const bool compact);
+
wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, const char *idname, struct EnumPropertyItem *items);
wmKeyMap *WM_modalkeymap_get(struct wmKeyConfig *keyconf, const char *idname);
wmKeyMapItem *WM_modalkeymap_add_item(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value);
@@ -98,7 +104,10 @@ int WM_keymap_map_type_get(struct wmKeyMapItem *kmi);
/* Key Event */
-const char *WM_key_event_string(short type);
+const char *WM_key_event_string(const short type, const bool compact);
+int WM_keymap_item_raw_to_string(
+ const short shift, const short ctrl, const short alt, const short oskey, const short keymodifier,
+ const short type, char *str, const int len, const bool compact);
int WM_key_event_operator_id(
const struct bContext *C, const char *opname, int opcontext,
struct IDProperty *properties, const bool is_hotkey,