add usage example for keygrabber API
To demonstrate keygrabber API usage, I added a small function to the docs that can be bound to a key and used to resize clients using keyboard. Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
78a1788c6f
commit
1d42fd9697
|
@ -12,6 +12,23 @@ module("keygrabber")
|
||||||
-- @param func A callback function as described above.
|
-- @param func A callback function as described above.
|
||||||
-- @name run
|
-- @name run
|
||||||
-- @class function
|
-- @class function
|
||||||
|
-- @usage Following function can be bound to a key, and used to resize a client
|
||||||
|
-- using keyboard.
|
||||||
|
-- <p><code>
|
||||||
|
-- function resize(c) <br/>
|
||||||
|
-- keygrabber.run(function(mod, key, event) </br>
|
||||||
|
-- if event == "release" then return true end </br><br/>
|
||||||
|
--
|
||||||
|
-- if key == 'Up' then awful.client.moveresize(0, 0, 0, 5, c) <br/>
|
||||||
|
-- elseif key == 'Down' then awful.client.moveresize(0, 0, 0, -5, c) <br/>
|
||||||
|
-- elseif key == 'Right' then awful.client.moveresize(0, 0, 5, 0, c) <br/>
|
||||||
|
-- elseif key == 'Left' then awful.client.moveresize(0, 0, -5, 0, c) <br/>
|
||||||
|
-- else keygrabber.stop() <br/>
|
||||||
|
-- end <br/><br/>
|
||||||
|
--
|
||||||
|
-- return true <br/>
|
||||||
|
-- end <br/>
|
||||||
|
-- </code></p>
|
||||||
|
|
||||||
--- Stop grabbing the keyboard.
|
--- Stop grabbing the keyboard.
|
||||||
-- @param -
|
-- @param -
|
||||||
|
|
Loading…
Reference in New Issue