Skip to content

Commit

Permalink
Use proper evdev paths on rM 2
Browse files Browse the repository at this point in the history
This would've caused a bug, where deselecting a "Input by" option,
will not have done the expected thing.
  • Loading branch information
LinusCDE committed Dec 28, 2020
1 parent 5b2bf55 commit 846359c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ use crate::rtc::Rtc;
pub const APP_NAME: &str = "Plato";
const FB_DEVICE: &str = "/dev/fb0";
const RTC_DEVICE: &str = "/dev/rtc0";
const EVENT_BUTTONS: &str = "/dev/input/event2"; // reMarkable gpio-keys
pub const EVENT_TOUCH_SCREEN: &str = "/dev/input/event1"; // reMarkable cyttsp5_mt (Multitouch)
pub const EVENT_WACOM: &str = "/dev/input/event0"; // reMarkable Wacom I2C Digitizer (Pen input)
lazy_static! {
pub static ref EVENT_BUTTONS: String = libremarkable::input::scan::SCANNED.gpio_path.to_str().unwrap().to_owned();
pub static ref EVENT_TOUCH_SCREEN: String = libremarkable::input::scan::SCANNED.multitouch_path.to_str().unwrap().to_owned();
pub static ref EVENT_WACOM: String = libremarkable::input::scan::SCANNED.wacom_path.to_str().unwrap().to_owned();
}
const KOBO_UPDATE_BUNDLE: &str = "/mnt/onboard/.kobo/KoboRoot.tgz";
const KEYBOARD_LAYOUTS_DIRNAME: &str = "keyboard-layouts";
const DICTIONARIES_DIRNAME: &str = "dictionaries";
Expand Down
4 changes: 2 additions & 2 deletions src/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ pub enum InputSource {
impl InputSource {
pub fn to_path(&self) -> &str {
match self {
InputSource::Pen => EVENT_WACOM,
InputSource::Touch => EVENT_TOUCH_SCREEN,
InputSource::Pen => &EVENT_WACOM,
InputSource::Touch => &EVENT_TOUCH_SCREEN,
}
}

Expand Down

0 comments on commit 846359c

Please sign in to comment.