On Sat, 29 Jun 2013 20:34:35 -0400 (EDT)
Maxfan Zone <[email protected]> wrote:

> Hi, everyone:
> 
> I tried this piece of code:
> 
> globalkeys = awful.util.table.join(
> awful.key({ "Mod3",           }, "1", function () awful.util.spawn("xdotool 
> key --clearmodifiers F1") end),
> awful.key({ "Mod3",           }, "Return", function() 
> awful.util.spawn("xterm") end)
> )
> 
> When I pressed Mod3 and Return at once, xterm started, but when I
> pressed Mod3 and 1 at once, it didn't work like F1 key.
> Can you help me?
> 
> Thank you very much!

This is because awesome is holding the input when xdotool is run.  Try
for example this:

    awful.key({ "Mod3" }, "1", function ()
        awful.util.spawn("sh -c 'xdotool key --clearmodifiers F1'")
    end),
    awful.key({}, "F1", function ()
        awful.util.spawn("notify-send 'Hello, world!'")
    end),

Awesome picks up the F1 press when you type Mod3+1.  You can insert a
delay to give your fingers time to release the keys before xdotool is
run, so that awesome will pass input through again:

    awful.key({ "Mod3" }, "1", function ()
        awful.util.spawn("sh -c 'sleep 0.5; xdotool key --clearmodifiers F1'")
    end),

- Bryan

-- 
To unsubscribe, send mail to [email protected].

Reply via email to