File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -960,6 +960,29 @@ mod test {
960960 assert_keys ( & [ ] , layout. keycodes ( ) ) ;
961961 }
962962
963+ #[ test]
964+ fn stacked_hold_tap ( ) {
965+ static LAYERS : Layers < 2 , 1 , 1 > = [ [ [
966+ k ( Enter ) ,
967+ HoldTap ( & HoldTapAction {
968+ timeout : 10 ,
969+ hold : k ( LAlt ) ,
970+ tap : k ( Space ) ,
971+ config : HoldTapConfig :: Default ,
972+ tap_hold_interval : 0 ,
973+ } ) ,
974+ ] ] ] ;
975+
976+ let mut layout = Layout :: new ( & LAYERS ) ;
977+ assert_eq ! ( CustomEvent :: NoEvent , layout. tick( ) ) ;
978+ // Push 2 events in a row, without ticking:
979+ // Press/Release attached to a HoldTap
980+ layout. event ( Press ( 0 , 1 ) ) ;
981+ layout. event ( Release ( 0 , 1 ) ) ;
982+ assert_eq ! ( CustomEvent :: NoEvent , layout. tick( ) ) ;
983+ assert_eq ! ( CustomEvent :: NoEvent , layout. tick( ) ) ;
984+ }
985+
963986 #[ test]
964987 fn multiple_actions ( ) {
965988 static LAYERS : Layers < 2 , 1 , 2 > = [
You can’t perform that action at this time.
0 commit comments