Text Entry field Cursor

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Text Entry field Cursor

Post by RossG »

I have a text entry field for the user to add/modify data.
It works but is inconvenient as the cursor can't be
positioned with the mouse. Tried "set cursor to arrow"
without success.

London to a brick there's an solution and someone
here knows what it is. (LC 7.1.2, Win XP)
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Text Entry field Cursor

Post by bogs »

Heya Ross.

There must be more to the story, I set up a plain text field, pasted your question into it, and then clicked in / out of the field. Whenever I clicked in the field, the cursor was placed at the mouse location, so that does seem to be the default behavior.
Image
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Text Entry field Cursor

Post by dunbarx »

as the cursor can't be
positioned with the mouse.
I am puzzled as well. LC is "ordinary" in the way it treats editable fields. Others have asked how to set the cursor in a body of text WITHOUT using the mouse. Is it possible this is what you meant?

Craig NEwman
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Text Entry field Cursor

Post by jacque »

Check the field properties. Locktext should be false, autohilite true, and traversalon true.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Text Entry field Cursor

Post by dunbarx »

Ah.

Jacque may have identified the issue.

is it that you want the user to be able to click on a word or line, and then have LC extract the pertinent data for further processing?

Something like:

Code: Select all

on mouseUp
answer the clickText
...etc.
Craig
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Text Entry field Cursor

Post by richmond62 »

how to set the cursor in a body of text WITHOUT using the mouse
I don't see why this should be a problem . . .
-

Code: Select all

on rawKeyDown RK
   if RK = 65470 then
      select after fld "ff"
   else
      pass rawKeyDown
      end if
end rawKeyDown
-
Texty.png
Last edited by richmond62 on Sat Jun 16, 2018 6:45 pm, edited 1 time in total.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Text Entry field Cursor

Post by richmond62 »

In fact, come to think of things, Jef Raskin tried to design a mouseless,
windowless, app-less operating system:

https://en.wikipedia.org/wiki/Jef_Raskin
Last edited by richmond62 on Sat Jun 16, 2018 7:44 pm, edited 1 time in total.
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Text Entry field Cursor

Post by jacque »

You guys may be overthinking this. It sounds like he just wants a normal editable text field.

Another reason for the failure could be a transparent button or field on top of the editable one.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Text Entry field Cursor

Post by richmond62 »

Code: Select all

on rawKeyDown RK
   switch RK
   case 65470
      select after fld "ff"
      break
   case 65471
      select after trueWord 1 of fld "ff"
      break
   case 65472
      --
   case 65474
      select the last trueWord of fld "ff"
      copy
      select after fld "gg"
      paste
      break
      default
      pass rawKeyDown
      end switch
end rawKeyDown
-
TextyTwo.png
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Text Entry field Cursor

Post by richmond62 »

TextyThree.png
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Text Entry field Cursor

Post by richmond62 »

TextyFour.png
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Text Entry field Cursor

Post by richmond62 »

TextyFive.png
-
Text Selector.livecode.zip
(65.19 KiB) Downloaded 485 times
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Text Entry field Cursor

Post by richmond62 »

Oddly enough that's probably where I have to control myself as, when I press the "F9" key on my
MacOS 10.7.5 system it "doesn't play ball."
-
lineWalk.jpg
-
Good fun while it lasted. 8)
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Text Entry field Cursor

Post by richmond62 »

I can't help thinking that our current dependence on mice,
trackpads and trackballs cramps our thinking in some ways.
-
mishka.jpg
mishka.jpg (4.2 KiB) Viewed 13664 times
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Text Entry field Cursor

Post by FourthWorld »

Ross, can you create a new stack, drag a field to it, and then after switching to the Browse tool edit the field contents?

If not, save that stack and post it here.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Post Reply