Workaround plugins that steal the keyboard focus
From awesome
There is a very long-standing bug in firefox that allows plugins (Flash, Acrobat, etc) to steal all of the keyboard shortcuts for the window. This is a simple workaround to return the keyboard focus to the top level window:
-- Escape from keyboard focus trap (eg Flash plugin in Firefox)
awful.key({ modkey, "Control" }, "Escape", function ()
awful.util.spawn("xdotool getactivewindow mousemove --window %1 0 0 click --clearmodifiers 2")
end),
xdotool must be installed.
Alternative method (without xdotool)
For example, use Move Mouse to move mouse pointer to a safe location (any area with no links or embedded Flash elements), then call the function below to simulate a mouse click (that brings the focus back).
-- Simulate mouse click
local function simulateClick()
root.fake_input("button_press", 1)
root.fake_input("button_release", 1)
end
-- Bind it to a key
awful.key({ modkey, }, "n", function() simulateClick() end),