I would like to use mouse events in my Twincat project. To do this I have included the TcMouseEvents.lib library in my project.
This library has the following functions:
GetLastLeftMouseDownEvent
GetLastLeftMouseUpEvent
GetLastMouseMoveEvent
GetLastRightMouseDownEvent
GetLastRightMouseUpEvent
MouseShowCursor
SetWindowToForeground
UseSIP
My target is a WinCE based panel with an ARM processor.
If I try to use any of the functions that contain a POINTER TO MOUSEEVENT then my project does not run. It will compile and download but when the applications tries to start I get the following error:
Communication Error (# 0): Performed Logout"
Examples of functions that use a POINTER TO MOUSEEVENT include:
I've included the following libs:
TcMouseEvents.lib
STANDARD.LIB
SysLibVisu.lib
SysLibTargetVisu.lib
Has anybody been able to get mouse events to work on a CE target?
The CoDeSys manual says the following but I'm not sure how to implement it:
Zitat:
The mouse handling also has to meet certain special requirements. As the visualisation code can not be executed often, mouse actions have to be saved so that later on, during the next run through the corresponding code area, they can be processed. For this purpose an array should be occupied which is able to save an even number of mouse-click actions. The same applies for all mouse movements after the activation of a tap (toggle FALSE) button, they too have to be saved.
Any help with this would be much appreaciated.
Regards, Ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to use mouse events in my Twincat project. To do this I have included the TcMouseEvents.lib library in my project.
This library has the following functions:
GetLastLeftMouseDownEvent
GetLastLeftMouseUpEvent
GetLastMouseMoveEvent
GetLastRightMouseDownEvent
GetLastRightMouseUpEvent
MouseShowCursor
SetWindowToForeground
UseSIP
My target is a WinCE based panel with an ARM processor.
If I try to use any of the functions that contain a POINTER TO MOUSEEVENT then my project does not run. It will compile and download but when the applications tries to start I get the following error:
Communication Error (# 0): Performed Logout"
Examples of functions that use a POINTER TO MOUSEEVENT include:
GetLastLeftMouseDownEvent
GetLastLeftMouseUpEvent
GetLastMouseMoveEvent
On the other hand if I use the MouseShowCursor function (which does not include a POINTER TO MOUSEEVENT) my project will run as expected.
From this it seems that the library is linking ok but I'm having trouble with functions that use a "POINTER TO MOUSEEVENT"
A very simple project looks like this:
I've included the following libs:
TcMouseEvents.lib
STANDARD.LIB
SysLibVisu.lib
SysLibTargetVisu.lib
Has anybody been able to get mouse events to work on a CE target?
The CoDeSys manual says the following but I'm not sure how to implement it:
Any help with this would be much appreaciated.
Regards, Ben
I've now got this working. Just in case anybody needs to do this in the future here's an example of how to implement mouse events.
The mouse will be very slow, and not all events will be seen by the program, however this is one of the better solutions.