finding multiple keystrokes

Brian Yennie briany at
Thu May 4 00:27:34 EDT 2006


How about something along the lines of:

constant keyThreshold = 500
local findString, lastKeyTime

on keydown key
   if (lastKeyTime is empty) OR (the milliseconds - lastKeyTime > 
keyThreshold) then
       put key into findString
      put key after findString
   end if
    find  normal findString in  field "list"
    put the milliseconds into lastKeyTime
end keydown

This is top-of-the-head untested, but the idea would be to track the 
time at which a key was pressed, and if another key is pressed quickly 
enough (with the keyThreshold), append that key to the find string 
instead of replacing it.


> the following will select, in a list field, only the first item that 
> starts with the first pressed key:
> on keydown key
> 	find  normal key in  field "list"
> end keydown
> but if field 'list' contains:
> abc
> agh
> aty
> how can I make it so that the third line will be selected if the user 
> presses "at"?
> Thanks,
> Steve
> _______________________________________________
> use-revolution mailing list
> use-revolution at
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:

More information about the Use-livecode mailing list