1 --- awesome keygrabber API
2 -- @author Julien Danjou <julien@danjou.info>
3 -- @copyright 2008-2009 Julien Danjou
7 -- Grab keyboard input and read pressed keys, calling a callback function at
8 -- each keypress, until @{keygrabber.stop} is called.
10 -- The callback function receives three arguments:
12 -- <li>a table containing modifiers keys</li>
13 -- <li>a string with the pressed key</li>
14 -- <li>a string with either "press" or "release" to indicate the event type.</li>
16 -- @param callback A callback function as described above.
20 -- -- The following function can be bound to a key, and used to resize a client
21 -- -- using the keyboard.
23 -- keygrabber.run(function(mod, key, event)
24 -- if event == "release" then return end
26 -- if key == 'Up' then awful.client.moveresize(0, 0, 0, 5, c)
27 -- elseif key == 'Down' then awful.client.moveresize(0, 0, 0, -5, c)
28 -- elseif key == 'Right' then awful.client.moveresize(0, 0, 5, 0, c)
29 -- elseif key == 'Left' then awful.client.moveresize(0, 0, -5, 0, c)
30 -- else keygrabber.stop()
35 --- Stop grabbing the keyboard.
39 --- Check if the keygrabber is running.
40 -- @return A boolean value, true if running, false otherwise.