2019-08-08 05:19:04 +03:00
|
|
|
[package]
|
|
|
|
name = "window"
|
|
|
|
version = "0.1.0"
|
|
|
|
authors = ["Wez Furlong"]
|
|
|
|
edition = "2018"
|
|
|
|
repository = "https://github.com/wez/wezterm"
|
|
|
|
description = "Cross platform window setup and render"
|
|
|
|
license = "MIT"
|
2019-10-25 01:54:41 +03:00
|
|
|
build = "build.rs"
|
|
|
|
|
2019-11-30 05:05:09 +03:00
|
|
|
[dev-dependencies]
|
2021-07-18 22:52:20 +03:00
|
|
|
k9 = "0.11.0"
|
2019-11-30 05:05:09 +03:00
|
|
|
|
2019-10-25 01:54:41 +03:00
|
|
|
[build-dependencies]
|
2020-12-29 23:13:23 +03:00
|
|
|
gl_generator = "0.14"
|
2019-08-08 05:19:04 +03:00
|
|
|
|
2021-06-27 03:05:22 +03:00
|
|
|
[features]
|
2021-06-27 05:16:56 +03:00
|
|
|
wayland = ["wayland-client", "smithay-client-toolkit", "wayland-egl", "wayland-protocols"]
|
2021-06-27 03:05:22 +03:00
|
|
|
|
2019-08-08 05:19:04 +03:00
|
|
|
[dependencies]
|
2021-05-04 18:38:43 +03:00
|
|
|
async-channel = "1.6"
|
2021-06-28 00:24:41 +03:00
|
|
|
async-io = "1.1"
|
2020-12-29 20:21:50 +03:00
|
|
|
async-task = "4.0"
|
2021-05-04 18:38:43 +03:00
|
|
|
async-trait = "0.1"
|
2019-12-15 08:43:05 +03:00
|
|
|
anyhow = "1.0"
|
2021-07-18 22:52:20 +03:00
|
|
|
bytes = "1.0"
|
2021-03-24 07:56:57 +03:00
|
|
|
config = { path = "../config" }
|
2022-11-16 17:40:56 +03:00
|
|
|
downcast-rs = "1.0"
|
2019-12-15 08:43:05 +03:00
|
|
|
thiserror = "1.0"
|
2021-08-16 04:21:17 +03:00
|
|
|
bitflags = "1.3"
|
2020-12-10 21:03:16 +03:00
|
|
|
euclid = "0.22"
|
2020-10-23 23:57:58 +03:00
|
|
|
guillotiere = "0.6"
|
2020-11-13 18:57:09 +03:00
|
|
|
lazy_static = "1.4"
|
2020-12-29 23:13:23 +03:00
|
|
|
libloading = "0.6"
|
2019-08-11 20:15:08 +03:00
|
|
|
line_drawing = "0.8"
|
2019-11-28 19:51:54 +03:00
|
|
|
log = "0.4"
|
2021-07-19 05:10:46 +03:00
|
|
|
metrics = { version="0.17", features=["std"]}
|
2019-08-08 05:19:04 +03:00
|
|
|
promise = { path = "../promise" }
|
2024-01-21 19:48:28 +03:00
|
|
|
raw-window-handle = "0.5"
|
2020-12-29 20:21:50 +03:00
|
|
|
resize = "0.5"
|
wezterm: add raw_code concept to input layer
This commit is a bit noisy because it also meant flipping the key map
code from using the termwiz input types to the window input types, which
I thought I'd done some time ago, but clearly didn't.
This commit allows defining key assignments in terms of the underlying
operating system raw codes, if provided by the relevant layer in the
window crate (currently, only X11/Wayland).
The raw codes are inherently OS/Machine/Hardware dependent; they are the
rawest value that we have available and there is no meaningful
understanding that we can perform in code to understand what that key
is.
One useful property of the raw code is that, because it hasn't gone
through any OS level keymapping processing, its value reflects its
physical position on the keyboard, allowing you to map keys by position
rather than by value. That's useful if you use software to implement
eg: DVORAK or COLEMAK but want your muscle memory to kick in for some of
your key bindings.
New config option:
`debug_key_events = true` will cause wezterm to log an "error" to stderr
each time you press a key and show the details in the key event:
```
2020-12-06T21:23:10.313Z ERROR wezterm_gui::gui::termwindow > key_event KeyEvent { key: Char('@'), modifiers: SHIFT | CTRL, raw_key: None, raw_modifiers: SHIFT | CTRL, raw_code: Some(11), repeat_count: 1, key_is_down: true }
```
This is useful if you want to figure out the `raw_code` for a key in your
setup.
In your config, you can use this information to setup new key bindings.
The motivating example for me is that because `raw_key` (the unmodified
equivalent of `key`) is `None`, the built-in `CTRL-SHIFT-1` key
assignment doesn't function for me on Linux, but I can now "fix" this in
my local configuration, taking care to make it linux specific:
```lua
local wezterm = require 'wezterm';
local keys = {}
if wezterm.target_triple == "x86_64-unknown-linux-gnu" then
local tab_no = 0
-- raw codes 10 through 19 correspond to the number key 1-9 positions
-- on my keyboard on my linux system. They may be different on
-- your system!
for i = 10, 20 do
table.insert(keys, {
key="raw:"..tostring(i),
mods="CTRL|SHIFT",
action=wezterm.action{ActivateTab=tab_no},
})
tab_no = tab_no + 1
end
end
return {
keys = keys,
}
```
Notice that the key assignment accepts encoding a raw key code using
a value like `key="raw:11"` to indicate that you want a `raw_code` of
`11` to match your key assignment. The `raw_modifiers` portion of
the `KeyEvent` is used together with the `raw_code` when deciding
the key assignment.
cc: @bew
2020-12-07 00:23:37 +03:00
|
|
|
serde = {version="1.0", features = ["rc", "derive"]}
|
2023-07-10 04:28:48 +03:00
|
|
|
tiny-skia = "0.11"
|
2022-04-04 16:49:09 +03:00
|
|
|
glium = { version = "0.31", default-features = false }
|
2022-06-20 14:41:25 +03:00
|
|
|
url = "2"
|
2022-01-25 19:27:01 +03:00
|
|
|
wezterm-bidi = { path = "../bidi" }
|
2022-02-05 23:59:54 +03:00
|
|
|
wezterm-color-types = { path = "../color-types" }
|
2021-06-27 05:48:06 +03:00
|
|
|
wezterm-font = { path = "../wezterm-font" }
|
2020-12-10 00:00:23 +03:00
|
|
|
wezterm-input-types = { path = "../wezterm-input-types" }
|
2019-08-08 05:19:04 +03:00
|
|
|
|
|
|
|
[target."cfg(windows)".dependencies]
|
2022-03-24 17:20:26 +03:00
|
|
|
clipboard-win = "2.2"
|
|
|
|
shared_library = "0.1"
|
2019-08-08 05:19:04 +03:00
|
|
|
winapi = { version = "0.3", features = [
|
2019-08-08 08:10:30 +03:00
|
|
|
"dwmapi",
|
2019-08-08 05:19:04 +03:00
|
|
|
"handleapi",
|
2019-11-02 19:35:19 +03:00
|
|
|
"imm",
|
2019-08-08 19:13:22 +03:00
|
|
|
"libloaderapi",
|
2023-08-06 19:11:11 +03:00
|
|
|
"shellscalingapi",
|
2019-08-08 05:19:04 +03:00
|
|
|
"synchapi",
|
2022-03-24 17:20:26 +03:00
|
|
|
"sysinfoapi",
|
2019-08-08 19:13:22 +03:00
|
|
|
"winerror",
|
|
|
|
"winuser",
|
2019-08-08 05:19:04 +03:00
|
|
|
]}
|
2022-03-24 17:20:26 +03:00
|
|
|
windows = { version="0.33.0", features = [
|
|
|
|
"UI_ViewManagement",
|
2022-07-06 22:54:18 +03:00
|
|
|
"Win32_Devices_Display",
|
2022-03-24 17:20:26 +03:00
|
|
|
]}
|
2022-04-19 19:56:23 +03:00
|
|
|
winreg = "0.10"
|
2019-08-08 05:19:04 +03:00
|
|
|
|
2019-08-09 03:44:57 +03:00
|
|
|
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
|
2021-03-09 09:00:42 +03:00
|
|
|
dirs-next = "2.0"
|
2021-05-24 00:24:01 +03:00
|
|
|
filedescriptor = { version="0.8", path = "../filedescriptor" }
|
2024-01-24 03:04:26 +03:00
|
|
|
x11 = {version ="2.21", features = ["xlib_xcb", "xlib"]}
|
2024-01-24 03:12:16 +03:00
|
|
|
xcb = {version="1.3", features=["render", "randr", "dri2", "xkb", "xlib_xcb", "present", "as-raw-xcb-connection"]}
|
2024-01-24 03:02:32 +03:00
|
|
|
xkbcommon = { version = "0.7.0", features = ["x11", "wayland"] }
|
2022-05-05 05:19:14 +03:00
|
|
|
mio = {version="0.8", features=["os-ext"]}
|
2019-08-09 21:15:09 +03:00
|
|
|
libc = "0.2"
|
2023-09-20 18:48:32 +03:00
|
|
|
smithay-client-toolkit = {version = "0.16.1", default-features=false, optional=true}
|
2021-12-28 17:28:07 +03:00
|
|
|
wayland-protocols = {version="0.29", optional=true}
|
|
|
|
wayland-client = {version="0.29", optional=true}
|
|
|
|
wayland-egl = {version="0.29", optional=true}
|
2024-01-24 03:12:16 +03:00
|
|
|
xcb-imdkit = { version="0.2", git="https://github.com/wez/xcb-imdkit-rs.git", branch="hangfix-xcb-1.3"}
|
2024-01-24 03:14:47 +03:00
|
|
|
zbus = "3.14"
|
|
|
|
zvariant = "3.15"
|
2022-07-13 18:54:24 +03:00
|
|
|
futures-util = "0.3"
|
2023-02-08 18:26:20 +03:00
|
|
|
futures-lite = "1.12"
|
2019-08-09 06:53:16 +03:00
|
|
|
|
|
|
|
[target.'cfg(target_os="macos")'.dependencies]
|
2023-08-06 03:33:59 +03:00
|
|
|
cocoa = "0.25"
|
2019-08-09 06:53:16 +03:00
|
|
|
objc = "0.2"
|
2019-11-13 11:05:55 +03:00
|
|
|
core-foundation = "0.7"
|
|
|
|
core-graphics = "0.19"
|
2020-12-29 23:13:23 +03:00
|
|
|
cgl = "0.3"
|
2023-01-11 04:58:35 +03:00
|
|
|
plist = "1.3"
|
2023-05-01 15:46:19 +03:00
|
|
|
shlex = "1.1"
|