Skip to content

Commit 846359c

Browse files
committed
Use proper evdev paths on rM 2
This would've caused a bug, where deselecting a "Input by" option, will not have done the expected thing.
1 parent 5b2bf55 commit 846359c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/app.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ use crate::rtc::Rtc;
4848
pub const APP_NAME: &str = "Plato";
4949
const FB_DEVICE: &str = "/dev/fb0";
5050
const RTC_DEVICE: &str = "/dev/rtc0";
51-
const EVENT_BUTTONS: &str = "/dev/input/event2"; // reMarkable gpio-keys
52-
pub const EVENT_TOUCH_SCREEN: &str = "/dev/input/event1"; // reMarkable cyttsp5_mt (Multitouch)
53-
pub const EVENT_WACOM: &str = "/dev/input/event0"; // reMarkable Wacom I2C Digitizer (Pen input)
51+
lazy_static! {
52+
pub static ref EVENT_BUTTONS: String = libremarkable::input::scan::SCANNED.gpio_path.to_str().unwrap().to_owned();
53+
pub static ref EVENT_TOUCH_SCREEN: String = libremarkable::input::scan::SCANNED.multitouch_path.to_str().unwrap().to_owned();
54+
pub static ref EVENT_WACOM: String = libremarkable::input::scan::SCANNED.wacom_path.to_str().unwrap().to_owned();
55+
}
5456
const KOBO_UPDATE_BUNDLE: &str = "/mnt/onboard/.kobo/KoboRoot.tgz";
5557
const KEYBOARD_LAYOUTS_DIRNAME: &str = "keyboard-layouts";
5658
const DICTIONARIES_DIRNAME: &str = "dictionaries";

src/settings/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ pub enum InputSource {
8282
impl InputSource {
8383
pub fn to_path(&self) -> &str {
8484
match self {
85-
InputSource::Pen => EVENT_WACOM,
86-
InputSource::Touch => EVENT_TOUCH_SCREEN,
85+
InputSource::Pen => &EVENT_WACOM,
86+
InputSource::Touch => &EVENT_TOUCH_SCREEN,
8787
}
8888
}
8989

0 commit comments

Comments
 (0)