@@ -450,8 +450,8 @@ pub fn default_key_bindings() -> Vec<KeyBinding> {
450450 Backspace , ModifiersState :: SHIFT , ~BindingMode :: VI , ~BindingMode :: SEARCH , ~BindingMode :: REPORT_ALL_KEYS_AS_ESC , ~BindingMode :: DISAMBIGUATE_ESC_CODES ; Action :: Esc ( "\x7f " . into( ) ) ;
451451 Enter => KeyLocation :: Numpad , ~BindingMode :: VI , ~BindingMode :: SEARCH , ~BindingMode :: REPORT_ALL_KEYS_AS_ESC , ~BindingMode :: DISAMBIGUATE_ESC_CODES ; Action :: Esc ( "\n " . into( ) ) ;
452452 // Vi mode.
453- Space , ModifiersState :: SHIFT | ModifiersState :: CONTROL , ~BindingMode :: SEARCH ; Action :: ToggleViMode ;
454- Space , ModifiersState :: SHIFT | ModifiersState :: CONTROL , +BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: ScrollToBottom ;
453+ " " , ModifiersState :: SHIFT | ModifiersState :: CONTROL , ~BindingMode :: SEARCH ; Action :: ToggleViMode ;
454+ " " , ModifiersState :: SHIFT | ModifiersState :: CONTROL , +BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: ScrollToBottom ;
455455 Escape , +BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: ClearSelection ;
456456 "i" , +BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: ToggleViMode ;
457457 "i" , +BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: ScrollToBottom ;
@@ -573,41 +573,41 @@ pub fn platform_key_bindings() -> Vec<KeyBinding> {
573573 KeyBinding ;
574574 Insert , ModifiersState :: SHIFT , ~BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: Esc ( "\x1b [2;2~" . into( ) ) ;
575575 // Tabbing api.
576- "t" , ModifiersState :: SUPER ; Action :: CreateNewTab ;
577- "]" , ModifiersState :: SUPER | ModifiersState :: SHIFT ; Action :: SelectNextTab ;
578- "[" , ModifiersState :: SUPER | ModifiersState :: SHIFT ; Action :: SelectPreviousTab ;
579- Tab , ModifiersState :: SUPER ; Action :: SelectNextTab ;
580- Tab , ModifiersState :: SUPER | ModifiersState :: SHIFT ; Action :: SelectPreviousTab ;
581- "1" , ModifiersState :: SUPER ; Action :: SelectTab1 ;
582- "2" , ModifiersState :: SUPER ; Action :: SelectTab2 ;
583- "3" , ModifiersState :: SUPER ; Action :: SelectTab3 ;
584- "4" , ModifiersState :: SUPER ; Action :: SelectTab4 ;
585- "5" , ModifiersState :: SUPER ; Action :: SelectTab5 ;
586- "6" , ModifiersState :: SUPER ; Action :: SelectTab6 ;
587- "7" , ModifiersState :: SUPER ; Action :: SelectTab7 ;
588- "8" , ModifiersState :: SUPER ; Action :: SelectTab8 ;
589- "9" , ModifiersState :: SUPER ; Action :: SelectLastTab ;
590- "0" , ModifiersState :: SUPER ; Action :: ResetFontSize ;
591- "=" , ModifiersState :: SUPER ; Action :: IncreaseFontSize ;
592- "+" , ModifiersState :: SUPER ; Action :: IncreaseFontSize ;
593- "-" , ModifiersState :: SUPER ; Action :: DecreaseFontSize ;
594- "k" , ModifiersState :: SUPER , ~BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: Esc ( "\x0c " . into( ) ) ;
595- "k" , ModifiersState :: SUPER , ~BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: ClearHistory ;
596- "v" , ModifiersState :: SUPER , ~BindingMode :: VI ; Action :: Paste ;
597- "v" , ModifiersState :: SUPER , +BindingMode :: VI , +BindingMode :: SEARCH ; Action :: Paste ;
598- "n" , ModifiersState :: SUPER ; Action :: CreateNewWindow ;
599- "f" , ModifiersState :: CONTROL | ModifiersState :: SUPER ; Action :: ToggleFullscreen ;
600- "c" , ModifiersState :: SUPER ; Action :: Copy ;
601- "c" , ModifiersState :: SUPER , +BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: ClearSelection ;
602- "h" , ModifiersState :: SUPER ; Action :: Hide ;
603- "h" , ModifiersState :: SUPER | ModifiersState :: ALT ; Action :: HideOtherApplications ;
604- "m" , ModifiersState :: SUPER ; Action :: Minimize ;
605- "q" , ModifiersState :: SUPER ; Action :: Quit ;
606- "w" , ModifiersState :: SUPER ; Action :: Quit ;
607- "f" , ModifiersState :: SUPER , ~BindingMode :: SEARCH ; Action :: SearchForward ;
608- "b" , ModifiersState :: SUPER , ~BindingMode :: SEARCH ; Action :: SearchBackward ;
609- "+" => KeyLocation :: Numpad , ModifiersState :: SUPER ; Action :: IncreaseFontSize ;
610- "-" => KeyLocation :: Numpad , ModifiersState :: SUPER ; Action :: DecreaseFontSize ;
576+ "t" , ModifiersState :: META ; Action :: CreateNewTab ;
577+ "]" , ModifiersState :: META | ModifiersState :: SHIFT ; Action :: SelectNextTab ;
578+ "[" , ModifiersState :: META | ModifiersState :: SHIFT ; Action :: SelectPreviousTab ;
579+ Tab , ModifiersState :: META ; Action :: SelectNextTab ;
580+ Tab , ModifiersState :: META | ModifiersState :: SHIFT ; Action :: SelectPreviousTab ;
581+ "1" , ModifiersState :: META ; Action :: SelectTab1 ;
582+ "2" , ModifiersState :: META ; Action :: SelectTab2 ;
583+ "3" , ModifiersState :: META ; Action :: SelectTab3 ;
584+ "4" , ModifiersState :: META ; Action :: SelectTab4 ;
585+ "5" , ModifiersState :: META ; Action :: SelectTab5 ;
586+ "6" , ModifiersState :: META ; Action :: SelectTab6 ;
587+ "7" , ModifiersState :: META ; Action :: SelectTab7 ;
588+ "8" , ModifiersState :: META ; Action :: SelectTab8 ;
589+ "9" , ModifiersState :: META ; Action :: SelectLastTab ;
590+ "0" , ModifiersState :: META ; Action :: ResetFontSize ;
591+ "=" , ModifiersState :: META ; Action :: IncreaseFontSize ;
592+ "+" , ModifiersState :: META ; Action :: IncreaseFontSize ;
593+ "-" , ModifiersState :: META ; Action :: DecreaseFontSize ;
594+ "k" , ModifiersState :: META , ~BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: Esc ( "\x0c " . into( ) ) ;
595+ "k" , ModifiersState :: META , ~BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: ClearHistory ;
596+ "v" , ModifiersState :: META , ~BindingMode :: VI ; Action :: Paste ;
597+ "v" , ModifiersState :: META , +BindingMode :: VI , +BindingMode :: SEARCH ; Action :: Paste ;
598+ "n" , ModifiersState :: META ; Action :: CreateNewWindow ;
599+ "f" , ModifiersState :: CONTROL | ModifiersState :: META ; Action :: ToggleFullscreen ;
600+ "c" , ModifiersState :: META ; Action :: Copy ;
601+ "c" , ModifiersState :: META , +BindingMode :: VI , ~BindingMode :: SEARCH ; Action :: ClearSelection ;
602+ "h" , ModifiersState :: META ; Action :: Hide ;
603+ "h" , ModifiersState :: META | ModifiersState :: ALT ; Action :: HideOtherApplications ;
604+ "m" , ModifiersState :: META ; Action :: Minimize ;
605+ "q" , ModifiersState :: META ; Action :: Quit ;
606+ "w" , ModifiersState :: META ; Action :: Quit ;
607+ "f" , ModifiersState :: META , ~BindingMode :: SEARCH ; Action :: SearchForward ;
608+ "b" , ModifiersState :: META , ~BindingMode :: SEARCH ; Action :: SearchBackward ;
609+ "+" => KeyLocation :: Numpad , ModifiersState :: META ; Action :: IncreaseFontSize ;
610+ "-" => KeyLocation :: Numpad , ModifiersState :: META ; Action :: DecreaseFontSize ;
611611 )
612612}
613613
@@ -678,6 +678,7 @@ impl<'a> Deserialize<'a> for BindingKey {
678678 "Left" => ( Key :: Named ( NamedKey :: ArrowLeft ) , KeyLocation :: Any ) ,
679679 "Right" => ( Key :: Named ( NamedKey :: ArrowRight ) , KeyLocation :: Any ) ,
680680 "At" => ( Key :: Character ( "@" . into ( ) ) , KeyLocation :: Any ) ,
681+ "Space" => ( Key :: Character ( " " . into ( ) ) , KeyLocation :: Any ) ,
681682 "Colon" => ( Key :: Character ( ":" . into ( ) ) , KeyLocation :: Any ) ,
682683 "Period" => ( Key :: Character ( "." . into ( ) ) , KeyLocation :: Any ) ,
683684 "LBracket" => ( Key :: Character ( "[" . into ( ) ) , KeyLocation :: Any ) ,
@@ -859,7 +860,9 @@ impl<'a> Deserialize<'a> for MouseButtonWrapper {
859860 E : de:: Error ,
860861 {
861862 match value {
862- 0 ..=65536 => Ok ( MouseButtonWrapper ( MouseButton :: Other ( value as u16 ) ) ) ,
863+ 0 ..=31 => {
864+ Ok ( MouseButtonWrapper ( MouseButton :: try_from_u8 ( value as u8 ) . unwrap ( ) ) )
865+ } ,
863866 _ => Err ( E :: invalid_value ( Unexpected :: Signed ( value) , & self ) ) ,
864867 }
865868 }
@@ -869,7 +872,9 @@ impl<'a> Deserialize<'a> for MouseButtonWrapper {
869872 E : de:: Error ,
870873 {
871874 match value {
872- 0 ..=65536 => Ok ( MouseButtonWrapper ( MouseButton :: Other ( value as u16 ) ) ) ,
875+ 0 ..=31 => {
876+ Ok ( MouseButtonWrapper ( MouseButton :: try_from_u8 ( value as u8 ) . unwrap ( ) ) )
877+ } ,
873878 _ => Err ( E :: invalid_value ( Unexpected :: Unsigned ( value) , & self ) ) ,
874879 }
875880 }
@@ -1221,7 +1226,7 @@ impl<'a> de::Deserialize<'a> for ModsWrapper {
12211226 let mut res = ModifiersState :: empty ( ) ;
12221227 for modifier in value. split ( '|' ) {
12231228 match modifier. trim ( ) . to_lowercase ( ) . as_str ( ) {
1224- "command" | "super" => res. insert ( ModifiersState :: SUPER ) ,
1229+ "command" | "super" => res. insert ( ModifiersState :: META ) ,
12251230 "shift" => res. insert ( ModifiersState :: SHIFT ) ,
12261231 "alt" | "option" => res. insert ( ModifiersState :: ALT ) ,
12271232 "control" => res. insert ( ModifiersState :: CONTROL ) ,
@@ -1405,7 +1410,7 @@ mod tests {
14051410 #[ test]
14061411 fn binding_trigger_mods ( ) {
14071412 let binding = MockBinding {
1408- mods : ModifiersState :: ALT | ModifiersState :: SUPER ,
1413+ mods : ModifiersState :: ALT | ModifiersState :: META ,
14091414 ..MockBinding :: default ( )
14101415 } ;
14111416
0 commit comments