Hi,

  Finally I had some time to test this. I created a timer and inside it I
call:

    printf("CURSORPOS=%s\n", IupGetGlobal("CURSORPOS"));

 It kept printing valid values even when I move the mouse to other
monitors. Also I activated other applications in the secondary monitor and
it kept working. I move the application itself for the second monitor and
it kept working. It is still working while I type this in a different
monitor...

 There is something else going on. I'm on Windows 10.

  This is a sample from the log:

CURSORPOS=8080x1181
CURSORPOS=8080x1181
CURSORPOS=7902x1062
CURSORPOS=7902x1062
CURSORPOS=7773x1061
CURSORPOS=6325x914
CURSORPOS=1913x715
CURSORPOS=1880x725
CURSORPOS=877x727
CURSORPOS=393x387
CURSORPOS=1x230
CURSORPOS=46x40
CURSORPOS=18x24
CURSORPOS=19x25
CURSORPOS=19x25
CURSORPOS=19x25
CURSORPOS=1167x703
CURSORPOS=1604x943
CURSORPOS=2388x1379
CURSORPOS=3509x1964
CURSORPOS=3752x2046
CURSORPOS=6419x1595
CURSORPOS=7381x1410
CURSORPOS=8955x1726
CURSORPOS=9211x1488
CURSORPOS=9202x1602
CURSORPOS=9206x1605
CURSORPOS=8272x1043

Best,
Scuri



Em qua., 22 de abr. de 2020 às 12:56, Milind Gupta <milind.gu...@gmail.com>
escreveu:

> I use a timer.
>
> On Wed, Apr 22, 2020, 5:58 AM Antonio Scuri <antonio.sc...@gmail.com>
> wrote:
>
>>   Do you use a timer or the idle callback to do that?
>>
>> Em qua., 22 de abr. de 2020 às 05:54, Milind Gupta <
>> milind.gu...@gmail.com> escreveu:
>>
>>> I don't have control over the motion_cb or button_cb call backs since
>>> they may change due to a selected operation. But if I want to display the
>>> coordinates on the canvas of the mouse position independently then to query
>>> the coordinates I use CURSORPOS and screenposition to determine it without
>>> depending on the callbacks.
>>>
>>> On Tue, Apr 21, 2020 at 6:27 PM Antonio Scuri <antonio.sc...@gmail.com>
>>> wrote:
>>>
>>>>   Hi,
>>>>
>>>>   I will have to do some tests here tomorrow. But the way to get mouse
>>>> coordinates in canvas is using those callbacks...
>>>>
>>>>   What you are trying to do? Why you have to use CURSORPOS?
>>>>
>>>> Best,
>>>> Scuri
>>>>
>>>>
>>>> Em ter, 21 de abr de 2020 20:43, Milind Gupta <milind.gu...@gmail.com>
>>>> escreveu:
>>>>
>>>>> Hi Antonio,
>>>>>            I am using CURSORPOS to determine the mouse position on the
>>>>> screen. I see that if I have a multi display setup as soon as my mouse 
>>>>> goes
>>>>> to the other display it returns nil. There is no error message.  Is there
>>>>> any particular way to handle multiple displays.
>>>>>            Also is there a way to directly get the mouse position in
>>>>> terms of the canvas coordinate system. Right now I determine the screen
>>>>> position of the mouse and then find the canvas position using
>>>>> SCREENPOSITION attribute and then take the difference. Basically I want to
>>>>> directly access the x,y coordinates without depending on the motion_cb or
>>>>> button_cb.
>>>>>
>>>>> Thanks,
>>>>> Milind
>>>>> _______________________________________________
>>>>> Iup-users mailing list
>>>>> Iup-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>>>>
>>>> _______________________________________________
>>>> Iup-users mailing list
>>>> Iup-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>>>
>>> _______________________________________________
>>> Iup-users mailing list
>>> Iup-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>>
>> _______________________________________________
>> Iup-users mailing list
>> Iup-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to