Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cyclefocus.key: modifier: convert from key #30

Merged
merged 2 commits into from
Dec 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,22 @@ function cyclefocus.key(mods, key, startdirection_or_args, args)
args.keys = {key}
end
end
args.keys = args.keys or {key}
args.modifier = args.modifier or mods[0]
if not args.modifier then
-- Convert modifier to key name.
-- Table from awful.key.
local conversion = {
mod4 = "Super_L",
control = "Control_L",
shift = "Shift_L",
mod1 = "Alt_L",
-- AltGr (https://github.com/awesomeWM/awesome/pull/2515).
mod5 = "ISO_Level3_Shift",
}
args.modifier = conversion[mods[1]:lower()]
if not args.modifier then
args.modifier = mods[1]
end
end

return awful.key(mods, key, function(c)
args.initiating_client = c -- only for clientkeys, might be nil!
Expand Down