Sample mouse driver source needed

i need to develop a very basic touch screen driver to use instead of the
available devices provided in the INPUT driver with QNX 4.25. Any sample
code or hints would be appreciated. Thanks

Have also interest !! Jörg

“John P. Larson” schrieb:

i need to develop a very basic touch screen driver to use instead of the
available devices provided in the INPUT driver with QNX 4.25. Any sample
code or hints would be appreciated. Thanks

============================================================================
Dipl.-Phys. Dr. Joerg Kampmann - Medizinische Hochschule Hannover
“Rechnergestuetzte Intensivpflege” OE 6204
D-30623 Hannover
Telefon: +49-(0)511-532-3438/3356 : Fax:+49-(0)511-532-8439
Mobilfunk (Handy E-Plus): +49-(0)177-276-3140
e-mail: kampmann@thg.mh-hannover.de / kampmann@ibk-consult.de
(Private)
www: http://www.mh-hannover.de/institut/ag_dv_intensiv/index.htm

@@@ -----------> QNX is a better RTOS (http://www.qnx.com) <----------
@@@

Previously, Jörg Kampmann wrote in comp.os.qnx:

Have also interest !! Jörg

Below is some basic code that causes a Mouse event to
be emitted. Most touch screens provide an input
serial screen which must be decoded and turned into
Mouse events. I think that that’s all the secrets.
The rest is just hard work.

You might want to see if QSSL will provide a sample
of their code.

Mitchell Schoenbrun --------- maschoen@pobox.com


#include <libc.h>
#include <time.h>
#include <Ph.h>
#include <assert.h>
#include <photon/PhT.h>
#define POSX 100
#define POSY 100

main( int argc, char *argv[] )
{
PhEvent_t event;
PhRect_t rect;
PhPointerEvent_t data;
int ret;

if ( NULL == PhAttach( NULL, NULL ) )
{
fprintf( stderr,“Couldn’t attach Photon channel.\n”);
exit( EXIT_FAILURE );
}

memset(&data,0,sizeof(data));
data.pos.x = POSX;
data.pos.y = POSY;

data.buttons = Ph_BUTTON_SELECT;
data.click_count = 1;
//data.buttons = Ph_BUTTON_MENU;
//data.buttons = Ph_BUTTON_ADJUST;

event.type = Ph_EV_BUT_PRESS;
event.subtype = 0;
event.emitter.rid = Ph_DEV_RID;
event.processing_flags = 0;
event.input_group = get_input_group();
event.flags = 0;
event.num_rects = 1;
event.data_len = sizeof(data);

rect.ul.x = POSX;
rect.ul.y = POSY;
rect.lr.x = POSX+1;
rect.lr.y = POSY+1;

ret = PhEventEmit( &event, &rect, &data );
if (ret == -1 && errno != ENOMSG)
{
fprintf(stderr,“Press ret %d\n”,ret);
perror(“Press”);
exit(-1);
}
sleep(1);

event.type = Ph_EV_BUT_RELEASE;
event.subtype = Ph_EV_RELEASE_REAL;
ret = PhEventEmit( &event, &rect, &data );
if (ret == -1 && errno != ENOMSG)
{
fprintf(stderr,“Release ret %d\n”,ret);
perror(“Release”);
}
}



int get_input_group( void )
{
char *ig_string;
int input_group;
PhRid_t rid;
PhRect_t rect;
PhRegion_t region;

/* Much of this code is referenced from
/usr/photon/apps/savers/puzzle.c */

ig_string = getenv( “PHIG” );
if ( ig_string )
input_group = atoi( ig_string );
else
input_group = 0;

PhQueryRids( 0, 0, input_group, Ph_INPUTGROUP_REGION, 0, 0, 0, &rid, 1 );
PhRegionQuery( rid, &region, &rect, NULL, 0 );

input_group = region.input_group;

return ( input_group );
}

Mitchell Schoenbrun <maschoen@pobox.com> wrote:

Most touch screens provide an input
serial screen which must be decoded and turned into
Mouse events. I think that that’s all the secrets.

u get get it… just poll /dev/ser1 while u move your finger over it…
(that’s how it turned out for mouse … i need a touch screen to actually
test it :wink:


Keep Smiling

Mechanically Yours

  • Mritunjai

II Year Sophomore
Mechanical Engg.
Indian Institute of Technology Bombay
India


Sent via Deja.com http://www.deja.com/
Before you buy.