Skip to content

Commit aebebe0

Browse files
Filter Nav Keymap to directions and stop
1 parent ffb2e58 commit aebebe0

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

Preferences.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,25 @@ def draw(self, context):
8484
# Keymap Customization
8585
import rna_keymap_ui
8686

87+
nav_names = [
88+
"FORWARD",
89+
"FORWARD_STOP",
90+
"BACKWARD",
91+
"BACKWARD_STOP",
92+
"LEFT",
93+
"LEFT_STOP",
94+
"RIGHT",
95+
"RIGHT_STOP",
96+
"UP",
97+
"UP_STOP",
98+
"DOWN",
99+
"DOWN_STOP",
100+
"LOCAL_UP",
101+
"LOCAL_UP_STOP",
102+
"LOCAL_DOWN",
103+
"LOCAL_DOWN_STOP",
104+
]
105+
87106
wm = bpy.context.window_manager
88107
active_kc = wm.keyconfigs.active
89108

@@ -109,7 +128,7 @@ def draw(self, context):
109128

110129
for kmi_con in km.keymap_items:
111130
if kmi_add.idname == kmi_con.idname:
112-
if kmi_add.name == kmi_con.name:
131+
if kmi_add.name == kmi_con.name and kmi_con.propvalue in nav_names:
113132
get_kmi_l.append((km, kmi_con))
114133

115134
get_kmi_l = sorted(set(get_kmi_l), key=get_kmi_l.index)

RightMouseNavigation.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,10 @@ def callMenu(self, context):
102102
if space_type == "NODE_EDITOR":
103103
node_tree = context.space_data.node_tree
104104
if node_tree:
105-
if (
106-
node_tree.nodes.active is not None
107-
and node_tree.nodes.active.select
108-
):
105+
if node_tree.nodes.active is not None and node_tree.nodes.active.select:
109106
bpy.ops.wm.call_menu(name="NODE_MT_context_menu")
110107
else:
111-
bpy.ops.wm.search_single_menu(
112-
"INVOKE_DEFAULT", menu_idname="NODE_MT_add"
113-
)
108+
bpy.ops.wm.search_single_menu("INVOKE_DEFAULT", menu_idname="NODE_MT_add")
114109
else:
115110
try:
116111
bpy.ops.wm.call_menu(name=self.menu_by_mode[context.mode])

blender_manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
schema_version = "1.0.0"
22

33
id = "right_mouse_navigation"
4-
version = "2.5.1"
4+
version = "2.5.2"
55
name = "Right Mouse Navigation"
66
tagline = "Game Engine Movement and Menus"
77
maintainer = "Spectral Vectors and Contributors"

0 commit comments

Comments
 (0)