MOUSE command problem (FW 2.1.14730)
|
08-07-2023, 03:02 PM
Post: #1
|
|||
|
|||
MOUSE command problem (FW 2.1.14730)
I tried to read the touch screen status in a loop. It's important that it's not a blocking function (like WAIT) because other tasks are executed in the meantime. I used the MOUSE() command, but it behaves oddly.
First, I'll provide an example of a program that works, but doesn't quite meet my expectations: Code:
Above, the coordinate retrieval is done by calling MOUSE() twice, which is not very neat, and with very fast movements, it can lead to returning the x coordinate from one point and the y from another, combining them into a single mismatched point on the screen that might not have been touched at all. A better solution would be to retrieve the MOUSE() result into a variable once and then operate on its components: Code:
Unfortunately, such a solution doesn't work. Despite the infinite loop, the program stops after several iterations of the loop and it doesn't even report an error. Moreover, MOUSE2 can only be run from the 'Program Catalog', but from the command line in 'Home', it returns "Error: Invalid input". Is this a bug? Regards Piotr Kowalewski |
|||
08-07-2023, 06:06 PM
Post: #2
|
|||
|
|||
RE: MOUSE command problem (FW 2.1.14730)
check for a return of an empty list of lists on mouse() and maybe slow down..
Code:
|
|||
08-07-2023, 07:05 PM
Post: #3
|
|||
|
|||
RE: MOUSE command problem (FW 2.1.14730)
Your correction indeed works! However, it doesn't change the fact that when the program is launched from the 'Program Catalog', it should signal an error instead of freezing.
Thanks. Piotr Kowalewski |
|||
08-08-2023, 07:58 PM
(This post was last modified: 08-09-2023 04:25 PM by matalog.)
Post: #4
|
|||
|
|||
RE: MOUSE command problem (FW 2.1.14730)
Does this work as you wanted it to?
Code: EXPORT pointer2() edit: Oh, I see you didn't want a Wait(-1). |
|||
08-08-2023, 08:07 PM
Post: #5
|
|||
|
|||
RE: MOUSE command problem (FW 2.1.14730)
There is something strange about the Mouse driver though, whether it is hardware or software based, i'm not sure. If you move your finger onto the screen from any side of the screen everything is fine, unless the side you move on from is the bottom, then MOUSE() will only register the initial x position and hold the 239 value as bottom of screen.
PS: I just realised as I was typing the last part that they must have kept the same code for the soft button menus in place for even MOUSE, as it would be a decent decision to ignore movements in from the bottom of screen if there were definitely going to be soft buttons there. Not a great decision when there are not definitely going to be soft buttons there. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)