mirror of
https://github.com/wayvr-org/wayvr.git
synced 2026-10-28 21:02:27 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40383f2529 | ||
|
|
b2429bce7f | ||
|
|
59c0bc870c | ||
|
|
4abfa3c3ac | ||
|
|
7037740d46 | ||
|
|
8ae65083f9 |
No files matched your search
Generated
+1
-1
@@ -4295,7 +4295,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wlx-overlay-s"
|
||||
version = "0.3.2"
|
||||
version = "0.4.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"ash",
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ debug = true
|
||||
|
||||
[package]
|
||||
name = "wlx-overlay-s"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -68,10 +68,14 @@ where
|
||||
|
||||
app.screens.clear();
|
||||
let data = if let Some(wl) = wl.as_mut() {
|
||||
keymap = get_keymap_wl().ok();
|
||||
keymap = get_keymap_wl()
|
||||
.map_err(|f| log::warn!("Could not load keyboard layout: {}", f))
|
||||
.ok();
|
||||
crate::overlays::screen::create_screens_wayland(wl, app)?
|
||||
} else {
|
||||
keymap = get_keymap_x11().ok();
|
||||
keymap = get_keymap_x11()
|
||||
.map_err(|f| log::warn!("Could not load keyboard layout: {}", f))
|
||||
.ok();
|
||||
match crate::overlays::screen::create_screens_x11pw(app) {
|
||||
Ok(data) => data,
|
||||
Err(e) => {
|
||||
|
||||
@@ -185,7 +185,8 @@ pub(super) fn find_libmonado() -> anyhow::Result<libloading::Library> {
|
||||
}
|
||||
}
|
||||
|
||||
const PROC_NAMES: [&str; 1] = ["monado-service"];
|
||||
const PROC_NAMES: [&str; 2] = ["monado-service", "wivrn-server"];
|
||||
|
||||
let mut system = sysinfo::System::new();
|
||||
system.refresh_processes();
|
||||
for p in system.processes().values() {
|
||||
@@ -201,16 +202,20 @@ pub(super) fn find_libmonado() -> anyhow::Result<libloading::Library> {
|
||||
}
|
||||
|
||||
fn proc_load_libmonado(proc: &Process) -> Option<libloading::Library> {
|
||||
let path = proc
|
||||
.exe()?
|
||||
.parent()?
|
||||
.parent()?
|
||||
.join("lib")
|
||||
.join("libmonado.so");
|
||||
// relative to folder containing binary
|
||||
const SEARCH_PATHS: [&str; 3] = [
|
||||
"../lib/libmonado.so",
|
||||
"../libmonado/libmonado.so",
|
||||
"../_deps/monado-build/src/xrt/targets/libmonado/libmonado.so",
|
||||
];
|
||||
|
||||
if path.exists() {
|
||||
Some(unsafe { libloading::Library::new(path).ok()? })
|
||||
} else {
|
||||
None
|
||||
for &p in SEARCH_PATHS.iter() {
|
||||
let path = proc.exe()?.parent()?.join(p);
|
||||
|
||||
if path.exists() {
|
||||
return Some(unsafe { libloading::Library::new(path).ok()? });
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
@@ -84,7 +84,9 @@ impl CustomClickAction {
|
||||
let res = self
|
||||
.action_bool_double
|
||||
.state(&state.session, xr::Path::NULL)?;
|
||||
if res.is_active && self.check_double_click(res.current_state) {
|
||||
if res.is_active
|
||||
&& ((before && res.current_state) || self.check_double_click(res.current_state))
|
||||
{
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
@@ -100,7 +102,10 @@ impl CustomClickAction {
|
||||
}
|
||||
|
||||
let res = self.action_f32.state(&state.session, xr::Path::NULL)?;
|
||||
if res.is_active && self.check_double_click(res.current_state > threshold) {
|
||||
if res.is_active
|
||||
&& ((before && res.current_state > threshold)
|
||||
|| self.check_double_click(res.current_state > threshold))
|
||||
{
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
left: "/user/hand/left/input/x/touch",
|
||||
right: "/user/hand/right/input/a/touch"
|
||||
},
|
||||
mouse_move: {
|
||||
move_mouse: {
|
||||
// used with focus_follows_mouse_mode
|
||||
left: "/user/hand/left/input/trigger/touch",
|
||||
right: "/user/hand/right/input/trigger/touch"
|
||||
@@ -140,7 +140,7 @@
|
||||
left: "/user/hand/left/input/a/touch",
|
||||
right: "/user/hand/right/input/a/touch"
|
||||
},
|
||||
mouse_move: {
|
||||
move_mouse: {
|
||||
// used with focus_follows_mouse_mode
|
||||
left: "/user/hand/left/input/trigger/touch",
|
||||
right: "/user/hand/right/input/trigger/touch"
|
||||
|
||||
@@ -10,6 +10,11 @@ pub fn get_keymap_x11() -> anyhow::Result<XkbKeymap> {
|
||||
|
||||
let (conn, _) = xcb::Connection::connect(None)?;
|
||||
let device_id = get_core_keyboard_device_id(&conn);
|
||||
if device_id == -1 {
|
||||
return Err(anyhow::anyhow!(
|
||||
"get_core_keyboard_device_id returned -1. Check your XKB installation."
|
||||
));
|
||||
}
|
||||
let keymap = keymap_new_from_device(&context, &conn, device_id, xkb::KEYMAP_COMPILE_NO_FLAGS);
|
||||
|
||||
Ok(XkbKeymap { context, keymap })
|
||||
|
||||
+47
-25
@@ -62,29 +62,51 @@ macros:
|
||||
# Value: Array of strings. 0th element is the upper row, 1st element is lower row.
|
||||
# For empty labels, use [] (do not use ~)
|
||||
labels:
|
||||
"Escape": ["Esc"]
|
||||
"Prior": ["PgUp"]
|
||||
"Next": ["PgDn"]
|
||||
"NumLock": ["Num"]
|
||||
"Space": []
|
||||
"LAlt": ["Alt"]
|
||||
"LCtrl": ["Ctrl"]
|
||||
"RCtrl": ["Ctrl"]
|
||||
"LSuper": ["Super"]
|
||||
"RSuper": ["Super"]
|
||||
"LShift": ["Shift"]
|
||||
"RShift": ["Shift"]
|
||||
"Insert": ["Ins"]
|
||||
"Delete": ["Del"]
|
||||
"BackSpace": ["<<"]
|
||||
"KP_Divide": [" /"]
|
||||
"KP_Add": [" +"]
|
||||
"KP_Multiply": [" *"]
|
||||
"KP_Decimal": [" ."]
|
||||
"KP_Subtract": [" -"]
|
||||
"KP_Enter": ["Ent"]
|
||||
"Print": ["Prn"]
|
||||
"Scroll": ["Scr"]
|
||||
"Pause": ["Brk"]
|
||||
"XF86Favorites": ["Rofi"]
|
||||
"Escape": ["Esc"]
|
||||
"Prior": ["PgUp"]
|
||||
"Next": ["PgDn"]
|
||||
"NumLock": ["Num"]
|
||||
"Space": []
|
||||
"LAlt": ["Alt"]
|
||||
"LCtrl": ["Ctrl"]
|
||||
"RCtrl": ["Ctrl"]
|
||||
"LSuper": ["Super"]
|
||||
"RSuper": ["Super"]
|
||||
"LShift": ["Shift"]
|
||||
"RShift": ["Shift"]
|
||||
"Insert": ["Ins"]
|
||||
"Delete": ["Del"]
|
||||
"BackSpace": ["<<"]
|
||||
"KP_Divide": [" /"]
|
||||
"KP_Add": [" +"]
|
||||
"KP_Multiply": [" *"]
|
||||
"KP_Decimal": [" ."]
|
||||
"KP_Subtract": [" -"]
|
||||
"KP_Enter": ["Ent"]
|
||||
"Print": ["Prn"]
|
||||
"Scroll": ["Scr"]
|
||||
"Pause": ["Brk"]
|
||||
"XF86Favorites": ["Menu"] # fallback labels below
|
||||
"N1": ["1", "!"]
|
||||
"N2": ["2", "@"]
|
||||
"N3": ["3", "#"]
|
||||
"N4": ["4", "$"]
|
||||
"N5": ["5", "%"]
|
||||
"N6": ["6", "^"]
|
||||
"N7": ["7", "&"]
|
||||
"N8": ["8", "*"]
|
||||
"N9": ["9", "("]
|
||||
"N0": ["0", ")"]
|
||||
"Minus": ["-", "_"]
|
||||
"Plus": ["=", "+"]
|
||||
"Comma": [" ,", "<"]
|
||||
"Period": [" .", ">"]
|
||||
"Oem1": [" ;", ":"]
|
||||
"Oem2": [" /", "?"]
|
||||
"Oem3": ["`", "~"]
|
||||
"Oem4": [" [", "{"]
|
||||
"Oem5": [" \\", "|"]
|
||||
"Oem6": [" ]", "}"]
|
||||
"Oem7": [" '", "\""]
|
||||
"Oem102": [" \\", "|"]
|
||||
|
||||
Reference in new issue
Block a user