mirror of
https://github.com/vlang/v.git
synced 2025-09-10 07:47:20 -04:00
term.ui,os.notify: fix .ctrl being stuck in examples/term.ui/event_viewer.v (regression happened in e9a3817a from 2023-02-20)
This commit is contained in:
parent
169a6b5ce0
commit
121fa0e92d
@ -159,7 +159,7 @@ fn (mut kn KqueueNotifier) close() ! {
|
||||
// event_mask_to_flag is a helper function that converts a bitmask
|
||||
// returned by kevent() wait to FdEventType
|
||||
fn event_mask_to_flag(filter i16, flags u16) FdEventType {
|
||||
mut res := FdEventType.read
|
||||
mut res := unsafe { FdEventType(0) }
|
||||
|
||||
if filter & notify.kqueue_read != 0 {
|
||||
res.set(.read)
|
||||
|
@ -140,7 +140,7 @@ fn (mut en EpollNotifier) close() ! {
|
||||
// event_mask_to_flag is a helper function that converts a bitmask
|
||||
// returned by epoll_wait to FdEventType
|
||||
fn event_mask_to_flag(mask u32) FdEventType {
|
||||
mut flags := FdEventType.read
|
||||
mut flags := unsafe { FdEventType(0) }
|
||||
|
||||
if mask & notify.epoll_read != 0 {
|
||||
flags.set(.read)
|
||||
|
@ -174,7 +174,7 @@ fn (mut ctx Context) parse_events() {
|
||||
else { unsafe { KeyCode(ascii) } }
|
||||
}
|
||||
|
||||
mut modifiers := Modifiers.ctrl
|
||||
mut modifiers := unsafe { Modifiers(0) }
|
||||
if e.dwControlKeyState & (0x1 | 0x2) != 0 {
|
||||
modifiers.set(.alt)
|
||||
}
|
||||
@ -204,7 +204,7 @@ fn (mut ctx Context) parse_events() {
|
||||
}
|
||||
x := e.dwMousePosition.X + 1
|
||||
y := int(e.dwMousePosition.Y) - sb_info.srWindow.Top + 1
|
||||
mut modifiers := Modifiers.ctrl
|
||||
mut modifiers := unsafe { Modifiers(0) }
|
||||
if e.dwControlKeyState & (0x1 | 0x2) != 0 {
|
||||
modifiers.set(.alt)
|
||||
}
|
||||
|
@ -427,7 +427,7 @@ fn escape_sequence(buf_ string) (&Event, int) {
|
||||
lo := typ & 0b00011
|
||||
hi := typ & 0b11100
|
||||
|
||||
mut modifiers := Modifiers.ctrl
|
||||
mut modifiers := unsafe { Modifiers(0) }
|
||||
if hi & 4 != 0 {
|
||||
modifiers.set(.shift)
|
||||
}
|
||||
@ -497,7 +497,7 @@ fn escape_sequence(buf_ string) (&Event, int) {
|
||||
// ----------------------------
|
||||
|
||||
mut code := KeyCode.null
|
||||
mut modifiers := Modifiers.ctrl
|
||||
mut modifiers := unsafe { Modifiers(0) }
|
||||
match buf {
|
||||
'[A', 'OA' { code = .up }
|
||||
'[B', 'OB' { code = .down }
|
||||
|
@ -18,10 +18,11 @@ vlib/v/checker/tests/enum_cast.vv:21:19: warning: 10 does not represent a value
|
||||
21 | println(unsafe { Permissions(0b1010) })
|
||||
| ~~~~~~~~~~~~~~~~~~~
|
||||
22 | println(unsafe { Permissions(-1) })
|
||||
23 | }
|
||||
23 | println(unsafe { Permissions(0) })
|
||||
vlib/v/checker/tests/enum_cast.vv:22:19: warning: -1 does not represent a value of enum Permissions
|
||||
20 | println(unsafe { Permissions(0b101) })
|
||||
21 | println(unsafe { Permissions(0b1010) })
|
||||
22 | println(unsafe { Permissions(-1) })
|
||||
| ~~~~~~~~~~~~~~~
|
||||
23 | }
|
||||
23 | println(unsafe { Permissions(0) })
|
||||
24 | }
|
||||
|
@ -20,4 +20,5 @@ fn main() {
|
||||
println(unsafe { Permissions(0b101) })
|
||||
println(unsafe { Permissions(0b1010) })
|
||||
println(unsafe { Permissions(-1) })
|
||||
println(unsafe { Permissions(0) })
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user