Compare commits
2 commits
3b24cd11a2
...
55b428cea6
| Author | SHA1 | Date | |
|---|---|---|---|
| 55b428cea6 | |||
| 1298ba3195 |
2 changed files with 3 additions and 7 deletions
|
|
@ -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,10 +131,6 @@ 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
|
||||
|
|
|
|||
|
|
@ -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_.base_layout_codepoint orelse key_.codepoint,
|
||||
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_.base_layout_codepoint orelse key_.codepoint,
|
||||
key_.codepoint,
|
||||
key_.shifted_codepoint orelse key_.codepoint,
|
||||
text orelse "",
|
||||
@as(u8, @bitCast(key_.mods)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue