Fix for #29056: NDOF motion events not configurable in user preferences.

This commit is contained in:
Brecht Van Lommel 2012-10-31 11:31:25 +00:00
parent c85488ff9e
commit ebdc9056af
2 changed files with 5 additions and 4 deletions

@ -186,10 +186,10 @@ class InputKeyMapPanel:
sub = split.column() sub = split.column()
subrow = sub.row(align=True) subrow = sub.row(align=True)
if map_type in {'KEYBOARD', 'NDOF'}: if map_type == 'KEYBOARD':
subrow.prop(kmi, "type", text="", event=True) subrow.prop(kmi, "type", text="", event=True)
subrow.prop(kmi, "value", text="") subrow.prop(kmi, "value", text="")
elif map_type == 'MOUSE': elif map_type in {'MOUSE', 'NDOF'}:
subrow.prop(kmi, "type", text="") subrow.prop(kmi, "type", text="")
subrow.prop(kmi, "value", text="") subrow.prop(kmi, "value", text="")

@ -122,6 +122,7 @@ EnumPropertyItem event_timer_type_items[] = {
}; };
EnumPropertyItem event_ndof_type_items[] = { EnumPropertyItem event_ndof_type_items[] = {
{NDOF_MOTION, "NDOF_MOTION", 0, "Motion", ""},
/* buttons on all 3dconnexion devices */ /* buttons on all 3dconnexion devices */
{NDOF_BUTTON_MENU, "NDOF_BUTTON_MENU", 0, "Menu", ""}, {NDOF_BUTTON_MENU, "NDOF_BUTTON_MENU", 0, "Menu", ""},
{NDOF_BUTTON_FIT, "NDOF_BUTTON_FIT", 0, "Fit", ""}, {NDOF_BUTTON_FIT, "NDOF_BUTTON_FIT", 0, "Fit", ""},
@ -622,8 +623,8 @@ static void rna_wmKeyMapItem_map_type_set(PointerRNA *ptr, int value)
kmi->val = KM_NOTHING; kmi->val = KM_NOTHING;
break; break;
case KMI_TYPE_NDOF: case KMI_TYPE_NDOF:
kmi->type = NDOF_BUTTON_MENU; kmi->type = NDOF_MOTION;
kmi->val = KM_PRESS; kmi->val = KM_NOTHING;
break; break;
} }
} }