From 8fc605abb89a3c6422a3934ee7651fca33876351 Mon Sep 17 00:00:00 2001 From: Anurag Priyam Date: Sun, 16 Jan 2011 23:14:59 +0530 Subject: [PATCH] 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 Signed-off-by: Uli Schlachter --- luadoc/keygrabber.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/luadoc/keygrabber.lua b/luadoc/keygrabber.lua index eb041f05..f7ae788e 100644 --- a/luadoc/keygrabber.lua +++ b/luadoc/keygrabber.lua @@ -12,6 +12,23 @@ module("keygrabber") -- @param func A callback function as described above. -- @name run -- @class function +-- @usage Following function can be bound to a key, and used to resize a client +-- using keyboard. +--

+-- function resize(c)
+-- keygrabber.run(function(mod, key, event)
+-- if event == "release" then return true end

+-- +-- if key == 'Up' then awful.client.moveresize(0, 0, 0, 5, c)
+-- elseif key == 'Down' then awful.client.moveresize(0, 0, 0, -5, c)
+-- elseif key == 'Right' then awful.client.moveresize(0, 0, 5, 0, c)
+-- elseif key == 'Left' then awful.client.moveresize(0, 0, -5, 0, c)
+-- else keygrabber.stop()
+-- end

+-- +-- return true
+-- end
+--

--- Stop grabbing the keyboard. -- @param -