-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #640 from hannobraun/window
Extract `fj-window` from `fj-viewer`
- Loading branch information
Showing
18 changed files
with
343 additions
and
182 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,43 @@ | ||
use crate::screen::Position; | ||
|
||
/// An input event | ||
pub enum Event { | ||
/// The cursor has moved to another position | ||
CursorMoved(Position), | ||
|
||
/// A key has been pressed or released | ||
Key(Key, KeyState), | ||
|
||
/// The user scrolled | ||
Scroll(f64), | ||
} | ||
|
||
/// A keyboard or mouse key | ||
pub enum Key { | ||
/// The escape key | ||
Escape, | ||
|
||
/// The numerical key `1` | ||
Key1, | ||
|
||
/// The numerical key `2` | ||
Key2, | ||
|
||
/// The numerical key `3` | ||
Key3, | ||
|
||
/// The left mouse key | ||
MouseLeft, | ||
|
||
/// The right mouse key | ||
MouseRight, | ||
} | ||
|
||
/// Defines the meaning of a key event | ||
pub enum KeyState { | ||
/// A key was pressed | ||
Pressed, | ||
|
||
/// A key was released | ||
Released, | ||
} |
Oops, something went wrong.