cleanups
This commit is contained in:
parent
6d466c65a4
commit
579869f2f0
21 changed files with 168 additions and 2771 deletions
|
|
@ -1,9 +1,6 @@
|
|||
use dioxus::{
|
||||
fullstack::{CborEncoding, WebSocketOptions, Websocket, extract::State, use_websocket},
|
||||
html::{
|
||||
geometry::{ElementSpace, euclid::Point2D},
|
||||
input_data::MouseButton,
|
||||
},
|
||||
html::input_data::MouseButton,
|
||||
logger::tracing,
|
||||
prelude::*,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pub fn KeyboardArea(onevent: EventHandler<ClientEvent>) -> Element {
|
|||
let v = evt.value();
|
||||
input_state.set(v.clone());
|
||||
|
||||
onevent.call(ClientEvent::TextInputEvent { text: v })
|
||||
onevent.call(ClientEvent::TextInputEvent { text: v });
|
||||
});
|
||||
let key_press_handler = use_callback(move |evt: Event<KeyboardData>| {
|
||||
if input_state.read().is_empty() {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
use std::{
|
||||
collections::{HashMap, VecDeque},
|
||||
ops::Sub,
|
||||
time::Duration,
|
||||
};
|
||||
use std::{collections::HashMap, ops::Sub, time::Duration};
|
||||
|
||||
use dioxus::{
|
||||
html::{
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ const BUTTON_RIGHT: u32 = 0x111;
|
|||
const BUTTON_MIDDLE: u32 = 0x112;
|
||||
|
||||
// https://wayland.app/protocols/wayland#wl_keyboard:enum:keymap_format
|
||||
#[expect(unused)]
|
||||
const NO_KEYMAP: u32 = 0;
|
||||
const XKB_V1: u32 = 1;
|
||||
|
||||
|
|
@ -233,8 +234,11 @@ enum InputProxyServiceState {
|
|||
keymap: Keymap,
|
||||
},
|
||||
Running {
|
||||
#[expect(unused)]
|
||||
seat: WlSeat,
|
||||
#[expect(unused)]
|
||||
virtual_pointer_manager: ZwlrVirtualPointerManagerV1,
|
||||
#[expect(unused)]
|
||||
virtual_keyboard_manager: ZwpVirtualKeyboardManagerV1,
|
||||
|
||||
virtual_pointer: ZwlrVirtualPointerV1,
|
||||
|
|
@ -282,7 +286,7 @@ impl InputProxyServiceState {
|
|||
}
|
||||
}
|
||||
|
||||
fn input_method_mut(&mut self) -> Option<&mut InputMethod> {
|
||||
const fn input_method_mut(&mut self) -> Option<&mut InputMethod> {
|
||||
match self {
|
||||
Self::Running { input_method, .. } => Some(input_method),
|
||||
Self::Incomplete { .. } => None,
|
||||
|
|
@ -480,7 +484,6 @@ impl Dispatch<ZwpInputMethodV2, ()> for InputProxyServiceState {
|
|||
_conn: &Connection,
|
||||
_qhandle: &QueueHandle<Self>,
|
||||
) {
|
||||
panic!();
|
||||
tracing::warn!("Unknown event received from ZwpInputMethodV2");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
#![expect(unused)]
|
||||
|
||||
use dioxus::logger::tracing;
|
||||
|
||||
fn is_key_string(s: &str) -> bool {
|
||||
s.chars().all(|c| !c.is_control()) && s.chars().skip(1).all(|c| !c.is_ascii())
|
||||
}
|
||||
|
||||
#[expect(clippy::too_many_lines)]
|
||||
pub fn web_key_to_linux_keycode(s: &str) -> Option<u32> {
|
||||
tracing::info!("Converting {s}");
|
||||
match s {
|
||||
|
|
|
|||
|
|
@ -57,16 +57,14 @@ impl MouseFilterBuffer {
|
|||
|
||||
let mut i = self.buffer.iter();
|
||||
|
||||
let mut last = if let Some(it) = i.find(|it| it.time >= start_time) {
|
||||
it
|
||||
} else {
|
||||
let Some(mut last) = i.find(|it| it.time >= start_time) else {
|
||||
return Vector2D::zero();
|
||||
};
|
||||
let start_time = last.time;
|
||||
let mut last_time = last.time;
|
||||
|
||||
for point in i {
|
||||
total_distance += (point.position - last.position);
|
||||
total_distance += point.position - last.position;
|
||||
last = point;
|
||||
last_time = point.time;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::components::{Controls, MouseArea};
|
||||
use crate::components::Controls;
|
||||
use dioxus::prelude::*;
|
||||
|
||||
/// The Home page component that will be rendered when the current route is `[Route::Home]`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue