Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_keymap.c
| Show All 31 Lines | |||||
| #include <string.h> | #include <string.h> | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| #include "DNA_windowmanager_types.h" | #include "DNA_windowmanager_types.h" | ||||
| #include "DNA_workspace_types.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | |||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| ▲ Show 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | bool WM_keymap_remove(wmKeyConfig *keyconf, wmKeyMap *keymap) | ||||
| else { | else { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| bool WM_keymap_poll(bContext *C, wmKeyMap *keymap) | bool WM_keymap_poll(bContext *C, wmKeyMap *keymap) | ||||
| { | { | ||||
| /* If we're tagged, only use compatible. */ | |||||
| if (keymap->ui_tag[0] != '\0') { | |||||
| const WorkSpace *workspace = CTX_wm_workspace(C); | |||||
| if (BKE_workspace_ui_tags_check(workspace, keymap->ui_tag) == false) { | |||||
| return false; | |||||
| } | |||||
| } | |||||
| if (keymap->poll != NULL) { | if (keymap->poll != NULL) { | ||||
| return keymap->poll(C); | return keymap->poll(C); | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| static void keymap_event_set(wmKeyMapItem *kmi, short type, short val, int modifier, short keymodifier) | static void keymap_event_set(wmKeyMapItem *kmi, short type, short val, int modifier, short keymodifier) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 1,508 Lines • Show Last 20 Lines | |||||