fix: filter out numlock and capslock from modifier keys

This commit is contained in:
CJ van den Berg 2024-02-29 10:41:11 +01:00
parent 21bac1ab0c
commit 55c4858192

View file

@ -376,6 +376,7 @@ fn dispatch_input_event(self: *Self, ni: *nc.Input) tp.result {
const keypress: u32 = ni.id; const keypress: u32 = ni.id;
var buf: [256]u8 = undefined; var buf: [256]u8 = undefined;
self.unrendered_input_events_count += 1; self.unrendered_input_events_count += 1;
ni.modifiers &= nc.mod.CTRL | nc.mod.SHIFT | nc.mod.ALT | nc.mod.SUPER | nc.mod.META | nc.mod.HYPER;
if (keypress == nc.key.RESIZE) return; if (keypress == nc.key.RESIZE) return;
if (keypress == nc.key.MOTION) { if (keypress == nc.key.MOTION) {
if (ni.y == 0 and ni.x == 0 and ni.ypx == -1 and ni.xpx == -1) return; if (ni.y == 0 and ni.x == 0 and ni.ypx == -1 and ni.xpx == -1) return;