Page 1 of 1

PostPosted: Fri Mar 16, 2001 2:46 pm
by airdrik
Is there a penevent function which is something like the keyevent function only acts as a screen tap at that location. ie:
<pre id=code><font face=courier size=2 id=code> penevent(200,200,PEN_DOWN,0);
/*specifies a mousedown event at location 200,200 with no special flags*/ </font id=code></pre id=code>

PostPosted: Fri Mar 16, 2001 3:09 pm
by Justinespinosa
Sorry, you can't simulate a pen event


OUTS Softwares

PostPosted: Sat Mar 17, 2001 3:11 pm
by guy
You could try this though:

// At the point where you want to fake a pen event:

iFakeX = 200 ;
iFakeY = 200 ;
postevent(PM_BUTTONDOWN) ;

// In your standard event loop:

iEvent = event(1) ;

switch (i_event) {

if ((iFakeX == -1) && ((iFakeY == -1)) {
iX = penx() ;
iY = peny() ;
} else {
iX = iFakeX ;
iY = iFakeY ;
iFakeX = -1 ;
iFakeY = -1 ;

// and then the rest of the event processing

or do it with a function that you call for pen events. Call it from the event loop for real events, and from the point where you want a fake event for fake events:

DoPenEvent(int iEvent, int iX, int iY) ;


DoPenEvent(PM_BUTTONDOWN, 200, 200) ;

or, from the event loop:

DoPenEvent(iEvent, penx(), peny()) ;


PostPosted: Sat Mar 17, 2001 3:22 pm
by Justinespinosa
Good, i thought that postevent() didn't post the events that already exists (1-11)


OUTS Softwares

PostPosted: Mon Mar 19, 2001 3:31 pm
by airdrik
What I want is a function like keyevent which posts to the system a pen tap so that I can write macros for various other programs. In other words I want to be able to run a program (using exec(...)) then post keyevents to send to that program simulating keystroks (this already works with the keyevent function) as well as simulated pen taps.