Skip to content

Commit

Permalink
Add support for exit_code and handle "Escape" in keys (#29)
Browse files Browse the repository at this point in the history
Fixes #17.
  • Loading branch information
blueyed authored Dec 27, 2018
1 parent 0f148cb commit f2a0472
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,14 @@ cyclefocus.cycle = function(startdirection_or_args, args)
local cycle_filters = awful.util.table.join(args.cycle_filters or {},
cyclefocus.cycle_filters)

-- Use "Escape" as exit_key if not used as key.
local exit_key = args.exit_key
if exit_key == nil then
if not awful.util.table.hasitem(keys, 'Escape') then
exit_key = 'Escape'
end
end

local filter_result_cache = {} -- Holds cached filter results.

local show_clients = args.show_clients
Expand Down Expand Up @@ -835,8 +843,7 @@ cyclefocus.cycle = function(startdirection_or_args, args)
.. ", event: " .. tostring(event)
.. ", modifier_key: " .. tostring(modifier), 3)

-- Abort on Escape.
if key == 'Escape' then
if exit_key and key == exit_key then
return exit_grabber(initiating_client)
end

Expand Down

0 comments on commit f2a0472

Please sign in to comment.