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:
@@ -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. ')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user