Implement map -release

This commit is contained in:
Marten Ringwelski
2020-09-15 13:46:08 +02:00
committed by Isaac Freund
parent 7e02fb679c
commit 52cd871151
5 changed files with 76 additions and 32 deletions

View File

@ -262,10 +262,10 @@ pub fn handleViewUnmap(self: *Self, view: *View) void {
/// Handle any user-defined mapping for the passed keysym and modifiers
/// Returns true if the key was handled
pub fn handleMapping(self: *Self, keysym: c.xkb_keysym_t, modifiers: u32) bool {
pub fn handleMapping(self: *Self, keysym: c.xkb_keysym_t, modifiers: u32, released: bool) bool {
const modes = &self.input_manager.server.config.modes;
for (modes.items[self.mode_id].mappings.items) |mapping| {
if (modifiers == mapping.modifiers and keysym == mapping.keysym) {
if (modifiers == mapping.modifiers and keysym == mapping.keysym and released == mapping.release) {
// Execute the bound command
const args = mapping.command_args;
var out: ?[]const u8 = null;