Ei protocol support
- Use the configured keyboard layout, track ei seats to reconfigure their keyboards - DBus interface - Disambiguate input devices per backend instance - Add support for `ei_keysym` and `ei_text` - Act as input method for ei_text UTF-8 injection - Create a region per output for abosolute pointer position - Map ei region for touchscreen emulation - Release pointer buttons and keys on removal - Send modifiers to EI connections
This commit is contained in:
parent
e939a72b30
commit
f4ee52c46a
15 changed files with 1092 additions and 218 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use crate::{
|
||||
config::{Action, PrivateAction},
|
||||
input::InputBackendId,
|
||||
shell::{
|
||||
FocusResult, InvalidWorkspaceIndex, MoveResult, SeatExt, Trigger, WorkspaceDelta,
|
||||
focus::{FocusTarget, target::KeyboardFocusTarget},
|
||||
|
|
@ -39,6 +40,7 @@ impl State {
|
|||
pub fn handle_action(
|
||||
&mut self,
|
||||
action: Action,
|
||||
backend_id: &InputBackendId,
|
||||
seat: &Seat<State>,
|
||||
serial: Serial,
|
||||
time: u32,
|
||||
|
|
@ -69,7 +71,7 @@ impl State {
|
|||
Action::Shortcut(action) => {
|
||||
let propagate = propagate_by_default(&action);
|
||||
self.handle_shortcut_action(
|
||||
action, seat, serial, time, pattern, direction, propagate,
|
||||
action, backend_id, seat, serial, time, pattern, direction, propagate,
|
||||
)
|
||||
}
|
||||
Action::Private(PrivateAction::Escape) => {
|
||||
|
|
@ -143,6 +145,7 @@ impl State {
|
|||
pub fn handle_shortcut_action(
|
||||
&mut self,
|
||||
action: shortcuts::Action,
|
||||
backend_id: &InputBackendId,
|
||||
seat: &Seat<State>,
|
||||
serial: Serial,
|
||||
time: u32,
|
||||
|
|
@ -232,6 +235,7 @@ impl State {
|
|||
{
|
||||
self.handle_shortcut_action(
|
||||
Action::SwitchOutput(inferred),
|
||||
backend_id,
|
||||
seat,
|
||||
serial,
|
||||
time,
|
||||
|
|
@ -271,6 +275,7 @@ impl State {
|
|||
{
|
||||
self.handle_shortcut_action(
|
||||
Action::SwitchOutput(inferred),
|
||||
backend_id,
|
||||
seat,
|
||||
serial,
|
||||
time,
|
||||
|
|
@ -392,6 +397,7 @@ impl State {
|
|||
} else {
|
||||
Action::SendToOutput(inferred)
|
||||
},
|
||||
backend_id,
|
||||
seat,
|
||||
serial,
|
||||
time,
|
||||
|
|
@ -417,6 +423,7 @@ impl State {
|
|||
} else {
|
||||
Action::SendToWorkspace(1)
|
||||
},
|
||||
backend_id,
|
||||
seat,
|
||||
serial,
|
||||
time,
|
||||
|
|
@ -483,6 +490,7 @@ impl State {
|
|||
} else {
|
||||
Action::SendToOutput(inferred)
|
||||
},
|
||||
backend_id,
|
||||
seat,
|
||||
serial,
|
||||
time,
|
||||
|
|
@ -508,6 +516,7 @@ impl State {
|
|||
} else {
|
||||
Action::SendToLastWorkspace
|
||||
},
|
||||
backend_id,
|
||||
seat,
|
||||
serial,
|
||||
time,
|
||||
|
|
@ -532,7 +541,9 @@ impl State {
|
|||
if propagate
|
||||
&& let Some((serial, prev_output, prev_idx)) =
|
||||
shell.previous_workspace_idx.take()
|
||||
&& seat.last_modifier_change().is_some_and(|s| s == serial)
|
||||
&& seat
|
||||
.last_modifier_change_for(backend_id)
|
||||
.is_some_and(|s| s == serial)
|
||||
&& prev_output == current_output
|
||||
{
|
||||
let _ = shell.activate(
|
||||
|
|
@ -705,6 +716,7 @@ impl State {
|
|||
if res.is_ok() {
|
||||
self.handle_shortcut_action(
|
||||
Action::SwitchOutput(direction),
|
||||
backend_id,
|
||||
seat,
|
||||
serial,
|
||||
time,
|
||||
|
|
@ -741,7 +753,8 @@ impl State {
|
|||
};
|
||||
|
||||
if let Some(direction) = dir {
|
||||
if let Some(last_mod_serial) = seat.last_modifier_change() {
|
||||
if let Some(last_mod_serial) = seat.last_modifier_change_for(backend_id)
|
||||
{
|
||||
let mut shell = self.common.shell.write();
|
||||
if !shell
|
||||
.previous_workspace_idx
|
||||
|
|
@ -776,6 +789,7 @@ impl State {
|
|||
|
||||
self.handle_shortcut_action(
|
||||
action,
|
||||
backend_id,
|
||||
seat,
|
||||
serial,
|
||||
time,
|
||||
|
|
@ -800,7 +814,7 @@ impl State {
|
|||
.move_current_element(direction, seat);
|
||||
match res {
|
||||
MoveResult::MoveFurther(_move_further) => {
|
||||
if let Some(last_mod_serial) = seat.last_modifier_change() {
|
||||
if let Some(last_mod_serial) = seat.last_modifier_change_for(backend_id) {
|
||||
let mut shell = self.common.shell.write();
|
||||
if !shell
|
||||
.previous_workspace_idx
|
||||
|
|
@ -834,6 +848,7 @@ impl State {
|
|||
|
||||
self.handle_shortcut_action(
|
||||
action,
|
||||
backend_id,
|
||||
seat,
|
||||
serial,
|
||||
time,
|
||||
|
|
|
|||
796
src/input/mod.rs
796
src/input/mod.rs
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue