Skip to content

Commit

Permalink
Merge pull request #30 from blueyed/alt
Browse files Browse the repository at this point in the history
cyclefocus.key: modifier: convert from key
  • Loading branch information
blueyed authored Dec 27, 2018
2 parents 6143d3e + 93bac81 commit 6d1dcd3
Showing 1 changed file with 16 additions and 2 deletions.
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

0 comments on commit 6d1dcd3

Please sign in to comment.