This patch expands the semantics of timeout() to cover the case in which it is used as a tap target. This facilitates a number of novel use cases, like discriminating between single/double tap or implementing per-key oneshot timeouts. Specifically timeout() is now defined in terms of arbitrary key events rather than the behaviour of the key to which it is bound (if any). The new definition executes the second action if no key events occur before the timeout expires. The implication of this is that when timeout() is executed as the result of a tap action, action2 will be executed after the timeout expires unless another key is struck in the interval. Note that this is backward compatible with the old definition, since a key up event (i.e a tap) will result in a resolution to the first action if timeout() is directly bound to a key. For Example: tab = overload(control, timeout(a, 100, b)) will presently produce no effect when 'tab' is tapped. Under the expanded definition, tapping tab will produce 'b' if 100 milliseconds elapse without an interceding key event.master
parent
f20bd7a441
commit
6b4f9f12ff
13 changed files with 241 additions and 79 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,24 @@ |
||||
up down |
||||
1ms |
||||
up up |
||||
up down |
||||
1ms |
||||
up up |
||||
up down |
||||
200ms |
||||
up up |
||||
up down |
||||
1ms |
||||
up up |
||||
100ms |
||||
x down |
||||
x up |
||||
|
||||
a down |
||||
a up |
||||
c down |
||||
c up |
||||
b down |
||||
b up |
||||
x down |
||||
x up |
||||
@ -0,0 +1,20 @@ |
||||
left down |
||||
99ms |
||||
left up |
||||
left down |
||||
299ms |
||||
left up |
||||
left down |
||||
300ms |
||||
left up |
||||
x down |
||||
x up |
||||
|
||||
a down |
||||
a up |
||||
b down |
||||
b up |
||||
c down |
||||
c up |
||||
x down |
||||
x up |
||||
@ -0,0 +1,31 @@ |
||||
right down |
||||
200ms |
||||
right up |
||||
right down |
||||
199ms |
||||
right up |
||||
99ms |
||||
x down |
||||
x up |
||||
right down |
||||
200ms |
||||
right up |
||||
right down |
||||
199ms |
||||
right up |
||||
100ms |
||||
x down |
||||
x up |
||||
|
||||
c down |
||||
c up |
||||
a down |
||||
a up |
||||
x down |
||||
x up |
||||
c down |
||||
c up |
||||
b down |
||||
b up |
||||
x down |
||||
x up |
||||
@ -0,0 +1,21 @@ |
||||
delete down |
||||
100ms |
||||
delete up |
||||
delete down |
||||
99ms |
||||
delete up |
||||
delete down |
||||
99ms |
||||
delete up |
||||
100ms |
||||
x down |
||||
x up |
||||
|
||||
leftcontrol down |
||||
leftcontrol up |
||||
a down |
||||
a up |
||||
b down |
||||
b up |
||||
x down |
||||
x up |
||||
@ -0,0 +1,19 @@ |
||||
= down |
||||
= up |
||||
299ms |
||||
x down |
||||
x up |
||||
= down |
||||
= up |
||||
300ms |
||||
x down |
||||
x up |
||||
|
||||
a down |
||||
a up |
||||
x down |
||||
x up |
||||
b down |
||||
b up |
||||
x down |
||||
x up |
||||
Loading…
Reference in new issue