Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BlenderPhi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
raas
BlenderPhi
Commits
03018353
Commit
03018353
authored
Feb 25, 2014
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
Fix T38827: Input preferences can not find Left Mouse or Left Arrow
parent
92653fe9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
release/scripts/modules/rna_keymap_ui.py
+26
-11
26 additions, 11 deletions
release/scripts/modules/rna_keymap_ui.py
with
26 additions
and
11 deletions
release/scripts/modules/rna_keymap_ui.py
+
26
−
11
View file @
03018353
...
@@ -255,6 +255,9 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
...
@@ -255,6 +255,9 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
# KeyMapItem like dict, use for comparing against
# KeyMapItem like dict, use for comparing against
# attr: {states, ...}
# attr: {states, ...}
kmi_test_dict
=
{}
kmi_test_dict
=
{}
# Special handling of 'type' using a list if sets,
# keymap items must match against all.
kmi_test_type
=
[]
# initialize? - so if a if a kmi has a MOD assigned it wont show up.
# initialize? - so if a if a kmi has a MOD assigned it wont show up.
#~ for kv in key_mod.values():
#~ for kv in key_mod.values():
...
@@ -265,11 +268,10 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
...
@@ -265,11 +268,10 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
if
kk
in
filter_text_split
:
if
kk
in
filter_text_split
:
filter_text_split
.
remove
(
kk
)
filter_text_split
.
remove
(
kk
)
kmi_test_dict
[
kv
]
=
{
True
}
kmi_test_dict
[
kv
]
=
{
True
}
# whats left should be the event type
# whats left should be the event type
if
len
(
filter_text_split
)
>
1
:
def
kmi_type_set_from_string
(
kmi_type
):
return
False
kmi_type
=
kmi_type
.
upper
()
elif
filter_text_split
:
kmi_type
=
filter_text_split
[
0
].
upper
()
kmi_type_set
=
set
()
kmi_type_set
=
set
()
if
kmi_type
in
_EVENT_TYPES
:
if
kmi_type
in
_EVENT_TYPES
:
...
@@ -288,25 +290,38 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
...
@@ -288,25 +290,38 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
for
k
,
v
in
event_type_map
.
items
():
for
k
,
v
in
event_type_map
.
items
():
if
(
kmi_type
in
k
)
or
(
kmi_type
in
v
):
if
(
kmi_type
in
k
)
or
(
kmi_type
in
v
):
kmi_type_set
.
add
(
v
)
kmi_type_set
.
add
(
v
)
return
kmi_type_set
kmi_type_set_combine
=
None
for
i
,
kmi_type
in
enumerate
(
filter_text_split
):
kmi_type_set
=
kmi_type_set_from_string
(
kmi_type
)
if
not
kmi_type_set
:
if
not
kmi_type_set
:
return
False
return
False
else
:
kmi_test_dict
[
"
type
"
]
=
kmi_type_set
kmi_test_type
.
append
(
kmi_type_set
)
# tiny optimization, sort sets so the smallest is first
# improve chances of failing early
kmi_test_type
.
sort
(
key
=
lambda
kmi_type_set
:
len
(
kmi_type_set
))
# main filter func, runs many times
# main filter func, runs many times
def
filter_func
(
kmi
):
def
filter_func
(
kmi
):
for
kk
,
ki
in
kmi_test_dict
.
items
():
for
kk
,
ki
in
kmi_test_dict
.
items
():
val
=
getattr
(
kmi
,
kk
)
val
=
getattr
(
kmi
,
kk
)
if
val
not
in
ki
:
return
False
# special handling of 'type'
for
ki
in
kmi_test_type
:
val
=
kmi
.
type
if
val
==
'
NONE
'
or
val
not
in
ki
:
if
val
==
'
NONE
'
or
val
not
in
ki
:
# exception for 'type'
# exception for 'type'
# also inspect 'key_modifier' as a fallback
# also inspect 'key_modifier' as a fallback
if
kk
==
"
type
"
:
val
=
kmi
.
key_modifier
val
=
getattr
(
kmi
,
"
key_modifier
"
)
if
not
(
val
==
'
NONE
'
or
val
not
in
ki
):
if
not
(
val
==
'
NONE
'
or
val
not
in
ki
):
continue
continue
return
False
return
False
return
True
return
True
for
km
,
kc
in
display_keymaps
:
for
km
,
kc
in
display_keymaps
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment