gtk: get num_lock state for key events

GTK doesn't expose the num_lock state via the key press event, this must
be obtained directly from the device. Set the num_lock state in the
modifier mask. This also will never show up as a `consumed_mod`, so we
don't bother setting it there.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tim Culverhouse
2023-12-12 16:43:55 -06:00
parent 20dbe9792e
commit eb8fc910e0

View File

@ -1376,6 +1376,8 @@ fn keyEvent(
else => {},
}
const device = c.gdk_event_get_device(event);
mods.num_lock = c.gdk_device_get_num_lock_state(device) == 1;
break :mods mods;
};