Compare commits

..

No commits in common. "55b428cea6cd8aaca430eecb3535abdbacf03456" and "3b24cd11a2813b6305df98aee0ed04e628d3dd10" have entirely different histories.

2 changed files with 7 additions and 3 deletions

View file

@ -119,7 +119,7 @@ pub const KeyEvent = struct {
pub fn from_message(
event_: Event,
keypress_: Key,
keypress_shifted: Key,
keypress_shifted_: Key,
text: []const u8,
modifiers: Mods,
) @This() {
@ -131,6 +131,10 @@ pub const KeyEvent = struct {
else => modifiers,
};
var keypress_shifted: Key = keypress_shifted_;
if (text.len > 0) blk: {
keypress_shifted = tryUtf8Decode(text) catch break :blk;
}
const keypress, const mods = if (keypress_shifted == keypress_)
map_key_to_unshifed_legacy(keypress_shifted, mods_)
else

View file

@ -284,7 +284,7 @@ pub fn process_renderer_event(self: *Self, msg: []const u8) Error!void {
const cbor_msg = try self.fmtmsg(.{
"I",
input.event.press,
key_.codepoint,
key_.base_layout_codepoint orelse key_.codepoint,
key_.shifted_codepoint orelse key_.codepoint,
text orelse "",
@as(u8, @bitCast(key_.mods)),
@ -298,7 +298,7 @@ pub fn process_renderer_event(self: *Self, msg: []const u8) Error!void {
const cbor_msg = try self.fmtmsg(.{
"I",
input.event.release,
key_.codepoint,
key_.base_layout_codepoint orelse key_.codepoint,
key_.shifted_codepoint orelse key_.codepoint,
text orelse "",
@as(u8, @bitCast(key_.mods)),