@@ -13,6 +13,7 @@ use std::ops::Deref;
1313use std:: sync:: { Arc , Mutex , MutexGuard , Weak } ;
1414
1515use wayland_client:: globals:: { BindError , GlobalList } ;
16+ use wayland_client:: protocol:: wl_keyboard:: WlKeyboard ;
1617use wayland_client:: protocol:: wl_seat:: WlSeat ;
1718use wayland_client:: protocol:: wl_surface;
1819use wayland_client:: WEnum ;
@@ -59,7 +60,7 @@ impl InputMethodManager {
5960 where
6061 D : Dispatch < XxInputMethodManagerV2 , GlobalData > + ' static ,
6162 {
62- let manager = globals. bind ( qh, 2 ..=2 , GlobalData ) ?;
63+ let manager = globals. bind ( qh, 3 ..=3 , GlobalData ) ?;
6364 Ok ( Self { manager } )
6465 }
6566
@@ -238,6 +239,25 @@ impl InputMethod {
238239 surface,
239240 }
240241 }
242+
243+ /// May cause a protocol error if there's a bound keyboard already.
244+ pub fn keyboard_bind ( & self , keyboard : & WlKeyboard ) {
245+ self . input_method . keyboard_bind ( & keyboard) ;
246+ }
247+
248+ /// May cause a protocol error if there's no bound keyboard.
249+ pub fn keyboard_unbind ( & self ) {
250+ self . input_method . keyboard_unbind ( ) ;
251+ }
252+
253+ /// May cause a protocol error on invalid serial.
254+ pub fn keyboard_consume (
255+ & self ,
256+ serial : u32 ,
257+ action : xx_input_method_v1:: KeyboardConsumeAction ,
258+ ) {
259+ self . input_method . keyboard_consume ( serial, action) ;
260+ }
241261}
242262
243263#[ derive( Debug ) ]
0 commit comments