Control of Text Fields.

Roger Guay irog at mac.com
Fri Nov 5 09:59:49 EDT 2021


I want them to do exactly the same thing that the keyboard keys do!! IOW, I want to emulate the delete key and the back and forward keys.

Roger

> On Nov 5, 2021, at 12:33 AM, Richmond Mathewson via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Surely the script depends on what you want those buttons to do.
> 
> On Fri, 5 Nov 2021 03:41 Roger Guay via use-livecode, <
> use-livecode at lists.runrev.com> wrote:
> 
>> Thanks, Alex. Sorry I didn’t make myself clear. I’m building a calculator
>> stack with forward and back arrow buttons and a Delete button. What's the
>> script for these buttons?
>> 
>> Roger
>> 
>>> On Nov 4, 2021, at 5:53 PM, Alex Tweedly via use-livecode <
>> use-livecode at lists.runrev.com> wrote:
>>> 
>>> Hi Roger,
>>> 
>>> I'm not sure I properly understand your question.
>>> 
>>> here's a code snippet the moves the insertion point (in this sample,
>> typing an 'f' moves it forward, 'b' moves it back). (Note this also works
>> if there is some text selected - it moves the insertion to just after the
>> selection, just like the arrow key does).
>>> 
>>>> on keydown p
>>>>   local t
>>>>   switch p
>>>>      case  "f"
>>>>         put word 4 of the selectedchunk into t
>>>>         select after char (t+1) of me
>>>>         break
>>>>      case "b"
>>>>         put word 2 of the selectedchunk into t
>>>>         select before char (t-1) of me
>>>>         break
>>>>   end  switch
>>>> end keydown
>>> To then delete the char in front of it, you'd do something like
>>> 
>>>   put empty into char (t+1) of me
>>> 
>>> Hope that's close enough to what you were asking, or at least gives you
>> a starting place  :-),
>>> 
>>> Alex.
>>> 
>>> On 04/11/2021 20:49, Roger Guay via use-livecode wrote:
>>>> I simply want to be able to move the insertion iBeam in a focused field
>> left and right, one char at a time (just like the left and right arrows
>> keys), and then to delete the char in front of it (just like the Delete
>> key). The dictionary was again of no use to me. Can someone please provide
>> sample scripts?
>>>> 
>>>> Thanks,
>>>> Roger
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list