1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

term.ui: use the new [flag] enums (#8881)

This commit is contained in:
spaceface
2021-02-21 15:07:49 +01:00
committed by GitHub
parent 0470baafa6
commit 260f677469
8 changed files with 92 additions and 81 deletions

View File

@@ -122,12 +122,6 @@ pub enum KeyCode {
f24 = 313
}
pub const (
shift = u32(1 << 0)
ctrl = u32(1 << 1)
alt = u32(1 << 2)
)
pub enum Direction {
unknown
up
@@ -154,6 +148,15 @@ pub enum EventType {
resized
}
[flag]
pub enum Modifiers {
ctrl
shift
alt
}
[inline] pub fn (m &Modifiers) is_empty() bool { return int(m) == 0 }
pub struct Event {
pub:
typ EventType
@@ -166,7 +169,7 @@ pub:
// Keyboard event info
code KeyCode
modifiers u32
modifiers Modifiers
ascii byte
utf8 string