2023-08-01 18:06:35 +02:00
|
|
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
2023-07-23 00:43:36 +02:00
|
|
|
|
|
|
|
---Input and keybinds
|
|
|
|
---@module InputModule
|
|
|
|
local input_module = {}
|
|
|
|
|
|
|
|
---Set a keybind. If called with an already existing keybind, it gets replaced.
|
|
|
|
---
|
|
|
|
---### Example
|
|
|
|
--- -- Set `Super + Return` to open Alacritty
|
|
|
|
--- input.keybind({ "Super" }, input.keys.Return, function()
|
|
|
|
--- process.spawn("Alacritty")
|
|
|
|
--- end)
|
|
|
|
---@tparam Modifier[] modifiers Which modifiers need to be pressed for the keybind to trigger.
|
2023-07-23 00:46:16 +02:00
|
|
|
---@tparam Keys key The key for the keybind.
|
2023-07-23 00:43:36 +02:00
|
|
|
---@tparam function action What to do.
|
|
|
|
function input_module.keybind(modifiers, key, action) end
|