@@ -181,13 +181,15 @@ pub trait KeyboardHandler: Sized {
181181 ///
182182 /// This happens when one of the modifier keys, such as "Shift", "Control" or "Alt" is pressed or
183183 /// released.
184+ #[ allow( clippy:: too_many_arguments) ]
184185 fn update_modifiers (
185186 & mut self ,
186187 conn : & Connection ,
187188 qh : & QueueHandle < Self > ,
188189 keyboard : & wl_keyboard:: WlKeyboard ,
189190 serial : u32 ,
190191 modifiers : Modifiers ,
192+ raw_modifiers : RawModifiers ,
191193 layout : u32 ,
192194 ) ;
193195
@@ -257,6 +259,14 @@ pub struct KeyEvent {
257259 pub utf8 : Option < String > ,
258260}
259261
262+ /// State of keyboard modifiers, in raw form sent by compositor.
263+ #[ derive( Debug , Clone , Copy , Default ) ]
264+ pub struct RawModifiers {
265+ pub depressed : u32 ,
266+ pub latched : u32 ,
267+ pub locked : u32 ,
268+ }
269+
260270/// The state of keyboard modifiers
261271///
262272/// Each field of this indicates whether a specified modifier is active.
@@ -830,9 +840,15 @@ where
830840 // Drop guard before calling user code.
831841 drop ( guard) ;
832842
843+ let raw_modifiers = RawModifiers {
844+ depressed : mods_depressed,
845+ latched : mods_latched,
846+ locked : mods_locked,
847+ } ;
848+
833849 // Always issue the modifiers update for the user.
834850 let modifiers = udata. update_modifiers ( ) ;
835- data. update_modifiers ( conn, qh, keyboard, serial, modifiers, group) ;
851+ data. update_modifiers ( conn, qh, keyboard, serial, modifiers, raw_modifiers , group) ;
836852 }
837853
838854 wl_keyboard:: Event :: RepeatInfo { rate, delay } => {
0 commit comments