summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/keyboard/key_code.rs37
-rw-r--r--core/src/point.rs6
-rw-r--r--core/src/size.rs6
3 files changed, 33 insertions, 16 deletions
diff --git a/core/src/keyboard/key_code.rs b/core/src/keyboard/key_code.rs
index 26020a57..74ead170 100644
--- a/core/src/keyboard/key_code.rs
+++ b/core/src/keyboard/key_code.rs
@@ -55,7 +55,7 @@ pub enum KeyCode {
Y,
Z,
- /// The Escape key, next to F1
+ /// The Escape key, next to F1.
Escape,
F1,
@@ -83,14 +83,14 @@ pub enum KeyCode {
F23,
F24,
- /// Print Screen/SysRq
+ /// Print Screen/SysRq.
Snapshot,
- /// Scroll Lock
+ /// Scroll Lock.
Scroll,
- /// Pause/Break key, next to Scroll lock
+ /// Pause/Break key, next to Scroll lock.
Pause,
- /// `Insert`, next to Backspace
+ /// `Insert`, next to Backspace.
Insert,
Home,
Delete,
@@ -103,11 +103,14 @@ pub enum KeyCode {
Right,
Down,
+ /// The Backspace key, right over Enter.
Backspace,
+ /// The Enter key.
Enter,
+ /// The space bar.
Space,
- /// The "Compose" key on Linux
+ /// The "Compose" key on Linux.
Compose,
Caret,
@@ -123,12 +126,20 @@ pub enum KeyCode {
Numpad7,
Numpad8,
Numpad9,
+ NumpadAdd,
+ NumpadDivide,
+ NumpadDecimal,
+ NumpadComma,
+ NumpadEnter,
+ NumpadEquals,
+ NumpadMultiply,
+ NumpadSubtract,
AbntC1,
AbntC2,
- Add,
Apostrophe,
Apps,
+ Asterisk,
At,
Ax,
Backslash,
@@ -137,8 +148,6 @@ pub enum KeyCode {
Colon,
Comma,
Convert,
- Decimal,
- Divide,
Equals,
Grave,
Kana,
@@ -152,19 +161,16 @@ pub enum KeyCode {
MediaSelect,
MediaStop,
Minus,
- Multiply,
Mute,
MyComputer,
- NavigateForward, // also called "Prior"
- NavigateBackward, // also called "Next"
+ NavigateForward, // also called "Next"
+ NavigateBackward, // also called "Prior"
NextTrack,
NoConvert,
- NumpadComma,
- NumpadEnter,
- NumpadEquals,
OEM102,
Period,
PlayPause,
+ Plus,
Power,
PrevTrack,
RAlt,
@@ -176,7 +182,6 @@ pub enum KeyCode {
Slash,
Sleep,
Stop,
- Subtract,
Sysrq,
Tab,
Underline,
diff --git a/core/src/point.rs b/core/src/point.rs
index 3714aa2f..7d93538f 100644
--- a/core/src/point.rs
+++ b/core/src/point.rs
@@ -46,6 +46,12 @@ impl From<[u16; 2]> for Point {
}
}
+impl From<Point> for [f32; 2] {
+ fn from(point: Point) -> [f32; 2] {
+ [point.x, point.y]
+ }
+}
+
impl std::ops::Add<Vector> for Point {
type Output = Self;
diff --git a/core/src/size.rs b/core/src/size.rs
index aceb5311..7c481935 100644
--- a/core/src/size.rs
+++ b/core/src/size.rs
@@ -56,3 +56,9 @@ impl From<[u16; 2]> for Size {
Size::new(width.into(), height.into())
}
}
+
+impl From<Size> for [f32; 2] {
+ fn from(size: Size) -> [f32; 2] {
+ [size.width, size.height]
+ }
+}