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 » Sat Jun 16, 2018 3:36 am

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Text Entry field Cursor

Post by bogs » Sat Jun 16, 2018 1:58 pm

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: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Text Entry field Cursor

Post by dunbarx » Sat Jun 16, 2018 4:10 pm

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: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Text Entry field Cursor

Post by jacque » Sat Jun 16, 2018 5:05 pm

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: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Text Entry field Cursor

Post by dunbarx » Sat Jun 16, 2018 5:37 pm

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: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Text Entry field Cursor

Post by richmond62 » Sat Jun 16, 2018 6:08 pm

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: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Text Entry field Cursor

Post by richmond62 » Sat Jun 16, 2018 6:12 pm

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: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Text Entry field Cursor

Post by jacque » Sat Jun 16, 2018 6:17 pm

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: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Text Entry field Cursor

Post by richmond62 » Sat Jun 16, 2018 6:44 pm

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: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Text Entry field Cursor

Post by richmond62 » Sat Jun 16, 2018 7:21 pm

TextyThree.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Text Entry field Cursor

Post by richmond62 » Sat Jun 16, 2018 7:42 pm

TextyFour.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Text Entry field Cursor

Post by richmond62 » Sat Jun 16, 2018 8:09 pm

TextyFive.png
-
Text Selector.livecode.zip
(65.19 KiB) Downloaded 168 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Text Entry field Cursor

Post by richmond62 » Sat Jun 16, 2018 8:11 pm

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: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Text Entry field Cursor

Post by richmond62 » Sat Jun 16, 2018 8:18 pm

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 7346 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Text Entry field Cursor

Post by FourthWorld » Sat Jun 16, 2018 11:33 pm

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

Return to “Getting Started with LiveCode - Complete Beginners”