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

@@ -12,15 +12,15 @@ fn event(e &tui.Event, x voidptr) {
app.tui.write('V term.input event viewer (press `esc` to exit)\n\n')
app.tui.write('$e')
app.tui.write('\n\nRaw event bytes: "$e.utf8.bytes().hex()" = $e.utf8.bytes()')
if e.modifiers != 0 {
if !e.modifiers.is_empty() {
app.tui.write('\nModifiers: $e.modifiers = ')
if e.modifiers & tui.ctrl != 0 {
if e.modifiers.has(.ctrl) {
app.tui.write('ctrl. ')
}
if e.modifiers & tui.shift != 0 {
if e.modifiers.has(.shift) {
app.tui.write('shift ')
}
if e.modifiers & tui.alt != 0 {
if e.modifiers.has(.alt) {
app.tui.write('alt. ')
}
}