Design: Sticky Keys (+ Integration Into Pies)
This is the design task for the sticky key implementation. The patch can be found in D840.
What Are Sticky Keys?
Our definition of a „sticky key“ is a short key, that has two operators assigned to it. The way you press the button decides, which operator is called. We distinguish between clicking (or tabbing) and holding down a key.
Note: You may know the term “sticky key” from Windows, but we use it differently (This is important as a lot of people reject sticky keys, because they don't want to have this Windows behavior in Blender)
Sticky Keys and Pies
The idea for sticky keys came up when @Antony Riakiotakis (psy-fi) was working on pie menus. He wanted to make it possible to click for example on tab to use the old and trusted Object Mode ↔ Edit Mode toggle behavior, while holding tab would spawn the pie menu for mode selection.
This would fit to other Pies as well, such as the spacebar (click → Search menu; hold → manipulator pie menu)
Click Timeout
A new option was added to the user preferences called “Click Timeout”. This value sets the time in milliseconds, under which we interpret a keystroke as click and over which we interpret it as holding.
How to Create Own Sticky Keys
This is really easy! You just have to change the short key of the desired operators to be the same and set the key value to click on one and hold on the other, via the following menu:
Update (Dec 2014):
After the first integration wasn't really promising and only halfway working, I reworked the patch entirely giving a much more workable result!
Call for Testing
To make sure that the new code doesn't break other events/handlers, we want to make sure everything works well, requiring good testing. So, help is really welcome and appreciated. Some testbuilds are below.
What shall we look for?
Typical issues are glitches that don't seem to be connected with sticky keys them self, but if you can't reproduce them in a master build, they're most likely a bug caused by sticky keys.
Those glitches appear mostly with modal operators (Knife-tool, Circle Select, etc) or modal actions (Gpencil, click and drag on number buttons, etc)
I spent a lot of time testing on my own and fixed all the issues I faced, but that doesn't mean there are none remaining ;)
You can use this thread for feedback or bug reports (the later only as long as the patch isn't merged with master).
Testbuilds
(updated 24 Dec 2014)