Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

feat: modifier key

mcfans26e77ba2c38f
diff --git a/Cargo.lock b/Cargo.lock
index 261f4a544..404ccf9dd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4914,7 +4914,7 @@ dependencies = [
[[package]]
name = "rdev"
version = "0.5.0-2"
-source = "git+https://github.com/mcfans/rdev#d643ea4542e61931cb20e1ecd390d6a3c9569171"
+source = "git+https://github.com/mcfans/rdev#97f63d5bc51bb2387d3f2664d3127640e492c9e5"
dependencies = [
"cocoa",
"core-foundation",
diff --git a/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/KeyboardKeyEventMapper.kt b/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/KeyboardKeyEventMapper.kt
index 47b237eaf..5686d30d9 100644
--- a/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/KeyboardKeyEventMapper.kt
+++ b/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/KeyboardKeyEventMapper.kt
@@ -9,8 +9,6 @@ object KeyEventConverter {
var chrValue = 0
var modifiers = 0
- android.util.Log.d(tag, "proto: $keyEventProto")
-
val keyboardMode = keyEventProto.getMode()
if (keyEventProto.hasChr()) {
@@ -28,12 +26,10 @@ object KeyEventConverter {
if (modifiersList != null) {
for (modifier in keyEventProto.getModifiersList()) {
val modifierValue = convertModifier(modifier)
- modifiers = modifiers and modifierValue
+ modifiers = modifiers or modifierValue
}
}
- android.util.Log.d(tag, "modifiers: $modifiersList")
-
var action = 0
if (keyEventProto.getDown()) {
action = KeyEvent.ACTION_DOWN
diff --git a/src/keyboard.rs b/src/keyboard.rs
index 20368c9d6..3baeef2ec 100644
--- a/src/keyboard.rs
+++ b/src/keyboard.rs
@@ -1072,6 +1072,8 @@ pub fn keycode_to_rdev_key(keycode: u32) -> Key {
return rdev::win_key_from_scancode(keycode);
#[cfg(any(target_os = "linux"))]
return rdev::linux_key_from_code(keycode);
+ #[cfg(any(target_os = "android"))]
+ return rdev::android_key_from_code(keycode);
#[cfg(target_os = "macos")]
return rdev::macos_key_from_code(keycode.try_into().unwrap_or_default());
}
diff --git a/src/server/connection.rs b/src/server/connection.rs
index 7f22bd8f9..96395e570 100644
--- a/src/server/connection.rs
+++ b/src/server/connection.rs
@@ -1728,11 +1728,7 @@ impl Connection {
Some(message::Union::KeyEvent(..)) => {}
#[cfg(any(target_os = "android"))]
Some(message::Union::KeyEvent(mut me)) => {
- let is_press = if cfg!(target_os = "linux") {
- (me.press || me.down) && !crate::is_modifier(&me)
- } else {
- me.press
- };
+ let is_press = (me.press || me.down) && !crate::is_modifier(&me);
let key = match me.mode.enum_value() {
Ok(KeyboardMode::Map) => {
@@ -1748,7 +1744,6 @@ impl Connection {
_ => None,
}
.filter(crate::keyboard::is_modifier);
- log::debug!("key:{:?}", key);
if let Some(key) = key {
if is_press {