core: remove redundant writes to input_state
This commit is contained in:
parent
a1dfaa2032
commit
f220494649
2 changed files with 8 additions and 23 deletions
|
|
@ -501,7 +501,6 @@ fn processEvent(x11: *X11, linux: *Linux, event: *c.XEvent) void {
|
|||
|
||||
switch (event.type) {
|
||||
c.KeyPress => {
|
||||
x11.state.input_state.keys.set(@intFromEnum(key_event.key));
|
||||
x11.state.pushEvent(.{ .key_press = key_event });
|
||||
|
||||
const codepoint = x11.libxkbcommon.xkb_keysym_to_utf32(@truncate(keysym));
|
||||
|
|
@ -510,7 +509,6 @@ fn processEvent(x11: *X11, linux: *Linux, event: *c.XEvent) void {
|
|||
}
|
||||
},
|
||||
c.KeyRelease => {
|
||||
x11.state.input_state.keys.unset(@intFromEnum(key_event.key));
|
||||
x11.state.pushEvent(.{ .key_release = key_event });
|
||||
},
|
||||
else => unreachable,
|
||||
|
|
@ -536,7 +534,6 @@ fn processEvent(x11: *X11, linux: *Linux, event: *c.XEvent) void {
|
|||
.mods = toMachMods(event.xbutton.state),
|
||||
};
|
||||
|
||||
x11.state.input_state.mouse_buttons.set(@intFromEnum(mouse_button.button));
|
||||
x11.state.pushEvent(.{ .mouse_press = mouse_button });
|
||||
},
|
||||
c.ButtonRelease => {
|
||||
|
|
@ -548,7 +545,6 @@ fn processEvent(x11: *X11, linux: *Linux, event: *c.XEvent) void {
|
|||
.mods = toMachMods(event.xbutton.state),
|
||||
};
|
||||
|
||||
x11.state.input_state.mouse_buttons.unset(@intFromEnum(mouse_button.button));
|
||||
x11.state.pushEvent(.{ .mouse_release = mouse_button });
|
||||
},
|
||||
c.ClientMessage => {
|
||||
|
|
@ -578,13 +574,11 @@ fn processEvent(x11: *X11, linux: *Linux, event: *c.XEvent) void {
|
|||
c.EnterNotify => {
|
||||
const x: f32 = @floatFromInt(event.xcrossing.x);
|
||||
const y: f32 = @floatFromInt(event.xcrossing.y);
|
||||
x11.state.input_state.mouse_position = .{ .x = x, .y = y };
|
||||
x11.state.pushEvent(.{ .mouse_motion = .{ .pos = .{ .x = x, .y = y } } });
|
||||
},
|
||||
c.MotionNotify => {
|
||||
const x: f32 = @floatFromInt(event.xmotion.x);
|
||||
const y: f32 = @floatFromInt(event.xmotion.y);
|
||||
x11.state.input_state.mouse_position = .{ .x = x, .y = y };
|
||||
x11.state.pushEvent(.{ .mouse_motion = .{ .pos = .{ .x = x, .y = y } } });
|
||||
},
|
||||
c.ConfigureNotify => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue