Get the screen position of the cursor
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Get the screen position of the cursor
- Attachments
-
- Type & Respond.livecode.zip
- Here's the stack
- (16.48 KiB) Downloaded 92 times
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Get the screen position of the cursor
Richmond.
You do not need all that. You can examine the "textChanged" message as you type each char, and see if the last three of the field fall into any of the stock patterns that will engender a substitution.
That is not what I am asking. It is whether it is required that the typist be alert to the current context so that he enters any of the prescribed text patterns.
Craig
You do not need all that. You can examine the "textChanged" message as you type each char, and see if the last three of the field fall into any of the stock patterns that will engender a substitution.
That is not what I am asking. It is whether it is required that the typist be alert to the current context so that he enters any of the prescribed text patterns.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Get the screen position of the cursor
Richmond.
I did not mean to be short. Sorry.
Anyway, in the field script, simply place:
The "beep" here just means we have typed a certain pattern, and now is the time to show the menu.
Craig
I did not mean to be short. Sorry.
Anyway, in the field script, simply place:
Code: Select all
on textChanged
if char - 3 to - 1 of me = "//t" then beep
end textChanged
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Get the screen position of the cursor
@banjaxd
If you see my last post, we might enhance the one-liner to read something like:
The "patterns of this card" is a custom property that contains, perhaps:
So much fun
Craig
If you see my last post, we might enhance the one-liner to read something like:
Code: Select all
if char - 3 to - 1 of me is among the lines of the patterns of this card then....
Now the menu can see that (1) it is time to reveal itself, and (2) will know which pattern was typed, and (3) will be able to populate itself with the appropriate menuItems"//t"
"//p"
etc.
So much fun
Craig
Last edited by dunbarx on Mon Nov 29, 2021 2:40 am, edited 4 times in total.
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Get the screen position of the cursor
It'll take more than that to offend me.I did not mean to be short.
Anyway, as a teacher, I tend to like to be long-winded: especially as all my code is worked out as I go along.
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Get the screen position of the cursor
I never work out my code as I go along.
Craig
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Get the screen position of the cursor
@banjaxd
Try this demo stack and me know if it works for you as a starter. You can change the actual menuItems, which are located in the custom properties of the card, as needed.
Craig
Try this demo stack and me know if it works for you as a starter. You can change the actual menuItems, which are located in the custom properties of the card, as needed.
Craig
Re: Get the screen position of the cursor
@Craig - thank you for the example, that's an ideal solution.
Also thank you to everyone else for your contribution and support. I'll post a link to the full solution when I'm done
Also thank you to everyone else for your contribution and support. I'll post a link to the full solution when I'm done
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Get the screen position of the cursor
banjaxd.
Good.
Make sure you check out the custom properties of the card to see how I put it together. That is where you will add your own tags and their contents.
Know also that the pulldown menu is made very small so that only the menuItems are visible. You can see that in the button script at the bottom of the card.
Craig
Good.
Make sure you check out the custom properties of the card to see how I put it together. That is where you will add your own tags and their contents.
Know also that the pulldown menu is made very small so that only the menuItems are visible. You can see that in the button script at the bottom of the card.
Craig