-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ForceFeedback): add force feedback support
- Loading branch information
1 parent
c047c23
commit 9a94b48
Showing
16 changed files
with
634 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/// Output capabilities describe what kind of output events a source input device | ||
/// is capable of handling. E.g. Force Feedback, LED control, etc. | ||
#[derive(Clone, Debug, PartialEq, Eq, Hash)] | ||
pub enum OutputCapability { | ||
ForceFeedback, | ||
#[allow(clippy::upper_case_acronyms)] | ||
LED(LED), | ||
} | ||
|
||
/// LED capability | ||
#[allow(clippy::upper_case_acronyms)] | ||
#[derive(Clone, Debug, PartialEq, Eq, Hash)] | ||
pub enum LED { | ||
Brightness, | ||
Color, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::sync::mpsc::Sender; | ||
|
||
use ::evdev::{FFEffectData, InputEvent}; | ||
|
||
/// Output events are events that flow from target devices back to source devices | ||
#[derive(Debug, Clone)] | ||
pub enum OutputEvent { | ||
Evdev(InputEvent), | ||
Uinput(UinputOutputEvent), | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
pub enum UinputOutputEvent { | ||
/// Effect data to upload to a source device and a channel to send back | ||
/// the effect ID. | ||
FFUpload(FFEffectData, Sender<Option<i16>>), | ||
/// Effect id to erase | ||
FFErase(u32), | ||
} |
Oops, something went wrong.