tty: handle key_release events
This commit is contained in:
parent
92883f5d42
commit
df2f936317
1 changed files with 10 additions and 0 deletions
10
src/Tty.zig
10
src/Tty.zig
|
@ -138,6 +138,16 @@ pub fn run(
|
||||||
loop.postEvent(.{ .key_press = mut_key });
|
loop.postEvent(.{ .key_press = mut_key });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
.key_release => |*key| {
|
||||||
|
if (@hasField(Event, "key_release")) {
|
||||||
|
// HACK: yuck. there has to be a better way
|
||||||
|
var mut_key = key;
|
||||||
|
if (key.text) |text| {
|
||||||
|
mut_key.text = cache.put(text);
|
||||||
|
}
|
||||||
|
loop.postEvent(.{ .key_release = mut_key });
|
||||||
|
}
|
||||||
|
},
|
||||||
.mouse => |mouse| {
|
.mouse => |mouse| {
|
||||||
if (@hasField(Event, "mouse")) {
|
if (@hasField(Event, "mouse")) {
|
||||||
loop.postEvent(.{ .mouse = mouse });
|
loop.postEvent(.{ .mouse = mouse });
|
||||||
|
|
Loading…
Reference in a new issue