@@ -31,7 +31,7 @@ pub use keyboard_types::{Code, Modifiers};
3131use std:: { borrow:: Borrow , fmt:: Display , hash:: Hash , str:: FromStr } ;
3232
3333#[ cfg( target_os = "macos" ) ]
34- pub const CMD_OR_CTRL : Modifiers = Modifiers :: SUPER ;
34+ pub const CMD_OR_CTRL : Modifiers = Modifiers :: META ;
3535#[ cfg( not( target_os = "macos" ) ) ]
3636pub const CMD_OR_CTRL : Modifiers = Modifiers :: CONTROL ;
3737
@@ -86,9 +86,11 @@ impl HotKey {
8686 /// Only [`Modifiers::ALT`], [`Modifiers::SHIFT`], [`Modifiers::CONTROL`], and [`Modifiers::SUPER`]
8787 pub fn new ( mods : Option < Modifiers > , key : Code ) -> Self {
8888 let mut mods = mods. unwrap_or_else ( Modifiers :: empty) ;
89- if mods. contains ( Modifiers :: META ) {
90- mods. remove ( Modifiers :: META ) ;
91- mods. insert ( Modifiers :: SUPER ) ;
89+
90+ #[ allow( deprecated) ]
91+ if mods. contains ( Modifiers :: SUPER ) {
92+ mods. remove ( Modifiers :: SUPER ) ;
93+ mods. insert ( Modifiers :: META ) ;
9294 }
9395
9496 Self {
@@ -107,7 +109,7 @@ impl HotKey {
107109 /// Returns `true` if this [`Code`] and [`Modifiers`] matches this hotkey.
108110 pub fn matches ( & self , modifiers : impl Borrow < Modifiers > , key : impl Borrow < Code > ) -> bool {
109111 // Should be a const but const bit_or doesn't work here.
110- let base_mods = Modifiers :: SHIFT | Modifiers :: CONTROL | Modifiers :: ALT | Modifiers :: SUPER ;
112+ let base_mods = Modifiers :: SHIFT | Modifiers :: CONTROL | Modifiers :: ALT | Modifiers :: META ;
111113 let modifiers = modifiers. borrow ( ) ;
112114 let key = key. borrow ( ) ;
113115 self . mods == * modifiers & base_mods && self . key == * key
@@ -125,8 +127,8 @@ impl HotKey {
125127 if self . mods . contains ( Modifiers :: ALT ) {
126128 hotkey. push_str ( "alt+" )
127129 }
128- if self . mods . contains ( Modifiers :: SUPER ) {
129- hotkey. push_str ( "super +" )
130+ if self . mods . contains ( Modifiers :: META ) {
131+ hotkey. push_str ( "meta +" )
130132 }
131133 hotkey. push_str ( & self . key . to_string ( ) ) ;
132134 hotkey
@@ -202,15 +204,15 @@ fn parse_hotkey(hotkey: &str) -> Result<HotKey, HotKeyParseError> {
202204 "CONTROL" | "CTRL" => {
203205 mods |= Modifiers :: CONTROL ;
204206 }
205- "COMMAND" | "CMD" | "SUPER" => {
206- mods |= Modifiers :: SUPER ;
207+ "COMMAND" | "CMD" | "SUPER" | "META" => {
208+ mods |= Modifiers :: META ;
207209 }
208210 "SHIFT" => {
209211 mods |= Modifiers :: SHIFT ;
210212 }
211213 #[ cfg( target_os = "macos" ) ]
212214 "COMMANDORCONTROL" | "COMMANDORCTRL" | "CMDORCTRL" | "CMDORCONTROL" => {
213- mods |= Modifiers :: SUPER ;
215+ mods |= Modifiers :: META ;
214216 }
215217 #[ cfg( not( target_os = "macos" ) ) ]
216218 "COMMANDORCONTROL" | "COMMANDORCTRL" | "CMDORCTRL" | "CMDORCONTROL" => {
0 commit comments