File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,8 +200,23 @@ impl Controller {
200200 /// # Arguments
201201 /// * `wlr_socket_path` - Wayland socket path
202202 pub fn new_wlroots ( wlr_socket_path : & str ) -> MaaResult < Self > {
203+ Self :: new_wlroots_with_vk_code ( wlr_socket_path, false )
204+ }
205+
206+ /// Create a new WlRoots controller for apps running in wlroots compositor on Linux.
207+ ///
208+ /// # Arguments
209+ /// * `wlr_socket_path` - Wayland socket path
210+ /// * `use_win32_vk_code` - Interpret key codes as Win32 Virtual-Key codes and translate
211+ /// them to Linux evdev codes internally when set to `true`
212+ pub fn new_wlroots_with_vk_code (
213+ wlr_socket_path : & str ,
214+ use_win32_vk_code : bool ,
215+ ) -> MaaResult < Self > {
203216 let c_path = CString :: new ( wlr_socket_path) ?;
204- let handle = unsafe { sys:: MaaWlRootsControllerCreate ( c_path. as_ptr ( ) ) } ;
217+ let handle = unsafe {
218+ sys:: MaaWlRootsControllerCreate ( c_path. as_ptr ( ) , use_win32_vk_code as sys:: MaaBool )
219+ } ;
205220
206221 Self :: from_handle ( handle)
207222 }
You can’t perform that action at this time.
0 commit comments