Page MenuHome

Editing anything in Screen Editing section of keymap completely corrupts keymap
Closed, ResolvedPublic

Description

System Information
Windows 10, GTX1080Ti

Blender Version
Broken: 2.8 and prior
Worked: Probably never

Short description of error
Whenever I try to edit any hotkey assignment in Screen\Screen Editing section of the keymap editor, exported keymap becomes completely corrupted when re-imported. This happens due to the fact there some hard-coded values for input action field. When keymap is exported, these fall back to the incorrect "Press" action, and when the keymap is reimported, press of any button with related modifier key assigned to the screen editing operations, such as Ctrl or Shift will trigger a window operation, making the entire keymap unusable.

The only solution for this is to manually open exported .py keymap file, and remove the entire screen editing section. This also means it is not possible to customize any keyboard shortcut present in the Screen Editing keymap section.

Exact steps for others to reproduce the error
1, In User Preferences window, Input panel, navigate to Screen/Screen editing section.
2, Change "Toggle Header" key mapping to a different key. This will trigger saving of the Screen Editing section into a keymap file.
3, Export key configuration
4, Restart Blender
5, Import the exported key configuration
6, Try to perform basic blender tasks that require Shift or Ctrl modifier key.
7, Notice screen editing actions happening instead.

Solution for this problem is to make Blender's keymap editor recognize these special input action values and save them correctly within the keymap file.

Revisions and Commits

Event Timeline

Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to 30.May 9 2018, 12:56 PM

Not sure I follow correctly:

  • I changed the "Toggle Header" shortcut to Ctrl+F9 (instead of Alt+F9)
  • exported keymap

When keymap is exported, these fall back to the incorrect "Press" action

Here I cant reproduce, my exported keymap file looks contains this:

kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])

# Map Screen Editing
km = kc.keymaps.new('Screen Editing', space_type='EMPTY', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('screen.actionzone', 'LEFTMOUSE', 'PRESS')
kmi_props_setattr(kmi.properties, 'modifier', 0)
kmi = km.keymap_items.new('screen.actionzone', 'LEFTMOUSE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'modifier', 1)
kmi = km.keymap_items.new('screen.actionzone', 'LEFTMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'modifier', 2)
kmi = km.keymap_items.new('screen.area_split', 'NONE', 'ANY')
kmi = km.keymap_items.new('screen.area_join', 'NONE', 'ANY')
kmi = km.keymap_items.new('screen.area_dupli', 'NONE', 'ANY', shift=True)
kmi = km.keymap_items.new('screen.area_swap', 'NONE', 'ANY', ctrl=True)
kmi = km.keymap_items.new('screen.region_scale', 'NONE', 'ANY')
kmi = km.keymap_items.new('screen.screen_full_area', 'NONE', 'ANY')
kmi_props_setattr(kmi.properties, 'use_hide_panels', True)
kmi = km.keymap_items.new('screen.area_move', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('screen.area_options', 'RIGHTMOUSE', 'PRESS')
kmi = km.keymap_items.new('screen.header', 'F9', 'PRESS', ctrl=True)

They fall back to ANY here (not PRESS) [which doesnt seem to produce issues -- but havent looked further]

Could you share your exported keymap?
Did I misunderstand something?

Marking as incomplete for the time being...

Not sure I follow correctly:

  • I changed the "Toggle Header" shortcut to Ctrl+F9 (instead of Alt+F9)
  • exported keymap

When keymap is exported, these fall back to the incorrect "Press" action

Here I cant reproduce, my exported keymap file looks contains this:

kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])

# Map Screen Editing
km = kc.keymaps.new('Screen Editing', space_type='EMPTY', region_type='WINDOW', modal=False)

kmi = km.keymap_items.new('screen.actionzone', 'LEFTMOUSE', 'PRESS')
kmi_props_setattr(kmi.properties, 'modifier', 0)
kmi = km.keymap_items.new('screen.actionzone', 'LEFTMOUSE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'modifier', 1)
kmi = km.keymap_items.new('screen.actionzone', 'LEFTMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'modifier', 2)
kmi = km.keymap_items.new('screen.area_split', 'NONE', 'ANY')
kmi = km.keymap_items.new('screen.area_join', 'NONE', 'ANY')
kmi = km.keymap_items.new('screen.area_dupli', 'NONE', 'ANY', shift=True)
kmi = km.keymap_items.new('screen.area_swap', 'NONE', 'ANY', ctrl=True)
kmi = km.keymap_items.new('screen.region_scale', 'NONE', 'ANY')
kmi = km.keymap_items.new('screen.screen_full_area', 'NONE', 'ANY')
kmi_props_setattr(kmi.properties, 'use_hide_panels', True)
kmi = km.keymap_items.new('screen.area_move', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('screen.area_options', 'RIGHTMOUSE', 'PRESS')
kmi = km.keymap_items.new('screen.header', 'F9', 'PRESS', ctrl=True)

They fall back to ANY here (not PRESS) [which doesnt seem to produce issues -- but havent looked further]

Could you share your exported keymap?
Did I misunderstand something?

Marking as incomplete for the time being...

Yes, sorry, It was supposed to be "Any", not "Press".

Now just close down Blender, open it again, go to Input panel in user preferences, click "Import key configuration" and load that exported file. Now if you try to work in 3D view for example, you should see issues.

Hm, yes, I imported that back in, but ANY doesnt seem to produce issues here?

  • I can CTRL+G to group, CTRL+Tab to enter weightpaint, I can SHIFT+click to add to selection, etc...

It would be the same as changing it from 'blank' to ANY in the default keymap as well, right? (so we wouldnt need the step of export/import keymap to reproduce...)
Do you have issues, setting all these 'blank' entries in the Screen\Screen Editing section to ANY in the default keymap as well?

I havent had a look at the code yet (I'm a little bit surprised myself), just saying: ANY doesnt seem to be an issue for these entries on my side...

Hm, yes, I imported that back in, but ANY doesnt seem to produce issues here?

  • I can CTRL+G to group, CTRL+Tab to enter weightpaint, I can SHIFT+click to add to selection, etc...

It would be the same as changing it from 'blank' to ANY in the default keymap as well, right? (so we wouldnt need the step of export/import keymap to reproduce...)
Do you have issues, setting all these 'blank' entries in the Screen\Screen Editing section to ANY in the default keymap as well?

I havent had a look at the code yet (I'm a little bit surprised myself), just saying: ANY doesnt seem to be an issue for these entries on my side...

I've made you a video so you can follow exactly same repro steps. Hopefully you'll be able to catch it now :)
https://www.youtube.com/watch?v=ZCrNRu9rAU0

Also, the best way to reproduce it after the input type is changed to "Any" is to switch the focus away from Blender's Window to a different one and then switch back. Then it should happen almost every time.

Philipp Oeser (lichtwerk) raised the priority of this task from 30 to 90.EditedMay 9 2018, 2:21 PM

Hi, thx for detailing.
Unfortunately: I followed the video exactly but still cannot reproduce.
I havent looked at code yet, not sure if this could be a windows thing [I'm on linux], might have a look later, but put this back to "Needs triage" for others to have a look as well...

I get a key reappearing again and again from a uninstalled addon and all was good about the remove...inactive become active and so on nightmare.