Page MenuHome

Event system & keymap support for key detecting/ignoring key repeat events
Needs ReviewPublic

Authored by Campbell Barton (campbellbarton) on Jun 30 2019, 8:14 AM.

Details

Summary

This patch adds is_repeat member to an event and an option for key-map items to handle repeat events.

The keymap author can choose if they want press events to activate when the key is held (this patch enables for text editing and frame changes, otherwise repeat events aren't acted on).

This resolves T40537: Holding down "R" causes rapid switching between rotate and trackball rotate.

Notes

  • Not proposing this for 2.80.
  • Currently only X11 is supported.
  • Uses ghost to track of the last held key which has auto-repeat enabled (using XKB when supported).
  • This isn't fool proof, once a non-blender window is active we can't tell the key state. Currently the held key is cleared when the window is activated.

Diff Detail

Repository
rB Blender
Branch
TEMP-EVENT-KEY-REPEAT-SUPPORT (branched from master)
Build Status
Buildable 4137
Build 4137: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) retitled this revision from Event system & keymap support for key repeat events to Event system & keymap support for key detecting/ignoring key repeat events.Jun 30 2019, 8:32 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
  • Add Event.is_repeat to RNA
  • Use ghost to detect key repeat events
  • Clear keys when a window is activated
  • Use xkb, remove use of set to stored held keys