Improve key swipe interface #962
Labels
enhancement
New feature or request
key swipe
something related to swiping, but not gesture typing
PR
Contributors are encouranged to submit a pull request. Just ask in case you are interested.
Currently key swipes (not gesture typing) work only on space an delete keys. Space swipe can be customized somewhat, delete swipe can only be enabled/disabled. Changing the interface to a more flexible
onKeySwipe(keyCode, direction)
andonEndSwipe(keyCode)
would allow simpler, more contained and also more customizable swipe actions:PointerTracker
)There are some things to consider though:
There is a single
KeyboardActionListener
, but mulitplePointerTrackers
(to allow multi-touch). This means theKeyboardActionListener
needs to be careful when keeping track of the swiping state. Maybe swipe actions will need to provide the pointer tracker id. Using multipleKeyboardActionListener
s will not work here, because currently theKeyboardActionListenerImpl
keeps track of the meta state (ctrl/alt/...), which should be global (though meta state could possible be handled in another place).Maybe the
KeyboardActionListener(Impl)
could internally use multiple KeySwipeListeners (which would handle the key swipes, and nothing else), one per pointer tracker. Using such aKeySwipeListener
with different implementations might also be useful for avoiding convoluted code when dealing with mutually exclusive key swipe styles.The whole thing should also consider performance, as
onKeySwipe
can be called very often.The text was updated successfully, but these errors were encountered: