Skip to content

Commit

Permalink
Merge remote-tracking branch 'linux/new-keyboard-linux' into new-keyb…
Browse files Browse the repository at this point in the history
…oard
  • Loading branch information
Kethku committed Jun 14, 2021
2 parents a9e0adb + f86c5e9 commit 1cc4d8b
Show file tree
Hide file tree
Showing 20 changed files with 2,293 additions and 1,387 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ targets = ["i686-pc-windows-msvc", "x86_64-pc-windows-msvc", "i686-unknown-linux
default = ["x11", "wayland"]
web-sys = ["web_sys", "wasm-bindgen", "instant/wasm-bindgen"]
stdweb = ["std_web", "instant/stdweb"]
x11 = ["x11-dl", "mio", "mio-misc", "percent-encoding", "parking_lot"]
wayland = ["wayland-client", "sctk"]
x11 = ["x11-dl", "mio", "mio-misc", "mio-extras", "percent-encoding", "parking_lot", "xkbcommon-dl/x11"]
wayland = ["wayland-client", "sctk", "memmap2"]

[dependencies]
instant = "0.1"
Expand Down Expand Up @@ -96,6 +96,8 @@ mio-misc = { version = "1.0", optional = true }
x11-dl = { version = "2.18.5", optional = true }
percent-encoding = { version = "2.0", optional = true }
parking_lot = { version = "0.11.0", optional = true }
memmap2 = { version = "0.2.1", optional = true }
xkbcommon-dl = { git = "https://github.com/maroider/xkbcommon-dl", rev = "900832888ad6f11011d1369befb344a9aa8a9610" }

[target.'cfg(target_arch = "wasm32")'.dependencies.web_sys]
package = "web-sys"
Expand Down
2 changes: 1 addition & 1 deletion src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl std::fmt::Debug for NativeKeyCode {
}
XKB(v) => {
debug_tuple = f.debug_tuple(name_of!(XKB));
debug_tuple.field(v);
debug_tuple.field(&format_args!("0x{:04X}", v));
}
Android(v) => {
debug_tuple = f.debug_tuple(name_of!(Android));
Expand Down
15 changes: 15 additions & 0 deletions src/platform/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ use std::os::raw;
use std::{ptr, sync::Arc};

use crate::{
event::KeyEvent,
event_loop::{EventLoop, EventLoopWindowTarget},
keyboard::Key,
monitor::MonitorHandle,
platform::modifier_supplement::KeyEventExtModifierSupplement,
window::{Window, WindowBuilder},
};

Expand Down Expand Up @@ -529,3 +532,15 @@ pub struct ARGBColor {
pub g: u8,
pub b: u8,
}

impl KeyEventExtModifierSupplement for KeyEvent {
#[inline]
fn text_with_all_modifiers(&self) -> Option<&str> {
self.platform_specific.text_with_all_modifiers
}

#[inline]
fn key_without_modifiers(&self) -> Key<'static> {
self.platform_specific.key_without_modifiers
}
}
Loading

0 comments on commit 1cc4d8b

Please sign in to comment.