[tekui-devel] tekui: Added keyboard control for focused element cursor; keydow...

Timm S. Mueller tmueller at neoscientists.org
Wed Mar 19 18:40:56 CET 2008


details:   http://hg.teklib.org/tekui/rev/89b6572d5c4f
changeset: 365:89b6572d5c4f
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Sat Mar 15 02:52:23 2008 +0100
description:
Added keyboard control for focused element cursor; keydown and keyup messages
are now differentiated; CookedKey renamed to KeyDown; cosmetic and verbosity
changes

diffs (truncated from 410 to 100 lines):

diff -r d35b66ca8a56 -r 89b6572d5c4f tek/app/plasma.lua
--- a/tek/app/plasma.lua	Wed Mar 05 22:57:54 2008 +0100
+++ b/tek/app/plasma.lua	Sat Mar 15 02:52:23 2008 +0100
@@ -22,7 +22,7 @@ local WH = HEIGHT * PIXHEIGHT
 --
 
 local v = visual.open("Plasma", WW, WH, WW, WH, WW, WH)
-v:setinput("close", "cookedkey", "interval")
+v:setinput("close", "keydown", "interval")
 
 --
 --	init
diff -r d35b66ca8a56 -r 89b6572d5c4f tek/app/ui/player.lua
--- a/tek/app/ui/player.lua	Wed Mar 05 22:57:54 2008 +0100
+++ b/tek/app/ui/player.lua	Sat Mar 15 02:52:23 2008 +0100
@@ -274,8 +274,8 @@ app = ui.application:new
 				e2:handleCloseMsg(msg)
 				return ui.window.handleCloseMsg(window, msg)
 			end,
-			handleCookedKeyMsg = function(window, msg)
-				return ui.window.handleCookedKeyMsg(window, msg)
+			handleKeyDownMsg = function(window, msg)
+				return ui.window.handleKeyDownMsg(window, msg)
 			end,
 
 			Orientation = 1,
diff -r d35b66ca8a56 -r 89b6572d5c4f tek/class/ui/drawable.lua
--- a/tek/class/ui/drawable.lua	Wed Mar 05 22:57:54 2008 +0100
+++ b/tek/class/ui/drawable.lua	Sat Mar 15 02:52:23 2008 +0100
@@ -19,7 +19,7 @@ local HUGE = ui.HUGE
 local HUGE = ui.HUGE
 
 module("tek.class.ui.drawable", tek.class.ui.object)
-_VERSION = "Drawable 3.0"
+_VERSION = "Drawable 3.1"
 
 -------------------------------------------------------------------------------
 -- Class implementation:
@@ -59,8 +59,8 @@ function Drawable:open(title, w, h, minw
 			self.DebugPen2 = self.Visual:allocpen(0, 0, 0)
 		end
 
-		self.Visual:setinput("close", "cookedkey", "newsize", "mousebutton",
-			"refresh", "mousemove", "mouseover", "interval", "focus")
+		self.Visual:setinput("close", "keydown", "keyup", "newsize",
+			"mousebutton", "refresh", "mousemove", "mouseover", "interval", "focus")
 
 		local penalloc = { }
 		for i, v in ipairs(self.Display.Theme.RGBTab) do
diff -r d35b66ca8a56 -r 89b6572d5c4f tek/class/ui/handle.lua
--- a/tek/class/ui/handle.lua	Wed Mar 05 22:57:54 2008 +0100
+++ b/tek/class/ui/handle.lua	Sat Mar 15 02:52:23 2008 +0100
@@ -16,7 +16,7 @@ local min = math.min
 local min = math.min
 
 module("tek.class.ui.handle", tek.class.ui.gadget)
-_VERSION = "Handle 1.9"
+_VERSION = "Handle 1.10"
 
 local Handle = _M
 
@@ -146,7 +146,7 @@ function Handle:startMove(x, y)
 		end
 	end
 
-	db.warn("mm[1]: %d - mm[2]: %d", -free0, free1)
+	db.info("mm[1]: %d - mm[2]: %d", -free0, free1)
 
 -- 	self.Move0 = xy[i1]
 	self.MoveMinMax[1] = -free0
diff -r d35b66ca8a56 -r 89b6572d5c4f tek/class/ui/textinput.lua
--- a/tek/class/ui/textinput.lua	Wed Mar 05 22:57:54 2008 +0100
+++ b/tek/class/ui/textinput.lua	Sat Mar 15 02:52:23 2008 +0100
@@ -15,7 +15,7 @@ local unpack = unpack
 local unpack = unpack
 
 module("tek.class.ui.textinput", tek.class.ui.gadget)
-_VERSION = "TextInput 1.8"
+_VERSION = "TextInput 1.9"
 
 -------------------------------------------------------------------------------
 --	Constants & Class data:
@@ -198,6 +198,7 @@ end
 
 function TextInput:onPress()
 	local fw, fh = ui.Display:textSize(self.Font, " ")
+	-- TODO: bullshit; need seperate onClick event to position cursor
 	local msg = self.Window:filterInput(self.Window.LMBDownMsg, self)
 	local x, y = msg[4], msg[5]
 	if x >= self.trect[1] and x <= self.trect[3] and y >= self.trect[2]
@@ -250,7 +251,7 @@ local function crsrright(self)
 	return true
 end
 
-function TextInput:handleCookedKeyMsg(msg)
+function TextInput:handleKeyDownMsg(msg)
 	local code = msg[3]
 	local t = self.Label
 
diff -r d35b66ca8a56 -r 89b6572d5c4f tek/class/ui/window.lua


More information about the tekui-devel mailing list