Page 1 of 2

Key lock

Posted: Tue Aug 13, 2024 4:23 pm
by liveCode
Is there a code that causes them not to be able to press keys on the keyboard? (by pressing them the computer will not respond)

Re: Key lock

Posted: Tue Aug 13, 2024 5:08 pm
by dunbarx
Hi.

You can trap "rawKeyDown" and "rawkeyUp".

That should prevent anything the user does.


Craig

Re: Key lock

Posted: Tue Aug 13, 2024 5:13 pm
by dunbarx
Be careful where you put that, like a frontScript, or at least remember where. :wink:

Craig

Re: Key lock

Posted: Tue Aug 13, 2024 6:34 pm
by liveCode
Thanks for the answer
Can you give me an example of the code that causes them not to be able to press the windows start key?

Re: Key lock

Posted: Tue Aug 13, 2024 6:52 pm
by Klaus
You can only prevent pressing keys on the keyboard INSIDE of your standalone!
We can NOT control anything outside your app, like the Windows key or whatever...

Re: Key lock

Posted: Tue Aug 13, 2024 7:01 pm
by liveCode
Is it possible to prevent the mouse from moving outside the stack boundaries?

Re: Key lock

Posted: Tue Aug 13, 2024 7:10 pm
by Klaus
No.


Your message contains 3 characters.
You need to enter at least 10 characters.

Re: Key lock

Posted: Tue Aug 13, 2024 8:51 pm
by dunbarx
Is it possible to prevent the mouse from moving outside the stack boundaries?
Yes. Here is a piece of the solution. It will prevent the cursor from moving past the right of the card window:

Code: Select all

on mouseMove x,y
   if item 1 of the mouseLoc > the right of this cd - 20 then set the screenmouseLoc to x - 20 & "," & y + the top of this stack
end mouseMove
You would need to include all four sides of the card window for a complete solution.

Craig

Re: Key lock

Posted: Tue Aug 13, 2024 8:52 pm
by dunbarx
Klaus.
Your message contains 3 characters.
You need to enter at least 10 characters.
???

Craig

Re: Key lock

Posted: Tue Aug 13, 2024 8:55 pm
by dunbarx
LiveCode.

The handler I gave is not perfect. System and LC timing will not prevent a fast movement of the mouse from penetrating that border. It will prevent moderate motion, however. The arbitrary values of "20" in the handler just give LC some breathing space. If you reduce those values, you can set up closer to the border, but the ability to blast through increases.

Anyone know how to "Speed up" the reaction time for this handler?

Craig

Re: Key lock

Posted: Tue Aug 13, 2024 9:31 pm
by Klaus
dunbarx wrote:
Tue Aug 13, 2024 8:52 pm
Klaus.
Your message contains 3 characters.
You need to enter at least 10 characters.
???
Craig
Try it yourself:
Enter a word with less than 10 characters as a response and click "Submit" :-)

Re: Key lock

Posted: Tue Aug 13, 2024 10:22 pm
by dunbarx
Klaus.

Where did that come up?

Craig

Re: Key lock

Posted: Wed Aug 14, 2024 8:50 am
by Klaus
See attached screenshot...
too_few_chars.png

Re: Key lock

Posted: Wed Aug 14, 2024 2:32 pm
by dunbarx
Klaus.

Well, since you are a moderator I assumed you saw something I did not. Anyway, I do not see that in my thread. Did you delete it?

Craig

Re: Key lock

Posted: Wed Aug 14, 2024 2:46 pm
by Klaus
OK, I will explain this very slowly... :-D

I wanted to respond to the namely posting with just "no."
But the forum software does not allow words shorter than 10 characters, therefore that warning appeared
on top of the entry field as seen in my screenshot. So I simply added this error text to satisfy the forum software.

This has nothing to do with being a moderator or no, this will also happen to you in that case!