Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Mouse sensitivity: (1 Item)
   
Mouse sensitivity  
I have a problem with mouse sensitivity being too great, I want to slow it down.

I am running QNX4.25 on a Siemens Simatic Panel 677B PC with an integrated mouse.

I have tried changing:

	/etc/config/trap/input 

using different permutations for the swtches 'rel -G -T' but this does not have the desired response.

I have also copied some source code from the QNX knowledgebase but variables 'gain' and 'threshold' are not declared in 
the structure '_pointer_ctrl', 

pointer.h. I am using Watcom 10.6.

Here is the code:

**************
#include <sys/pointer.h>
#include <Ph.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/kernel.h>
#include <sys/sendmx.h>

union {
  struct {
    struct _Ph_msg_forward      forward;
  } send;
  struct {
    struct _Ph_msg_hdr_reply    hdr;
    int                          result;
  } reply;
} msg;

struct {
  PhRegionDataHdr_t              hdr;
  struct _interact_mgr          info;
} region_data;

main(int argc, char *argv[])
{

  struct _Ph_ctrl              *ph;
  int                          gain;
  PhConnectId_t                conn_id;
  struct _pointer_ctrl          ctrl;
  PhRect_t                      rect;
  PhRegion_t                    region;
  PhRid_t                      rids[10];
  int                          nreg;
  int                          i;
  struct _pointer_ctrl          pctrl;
  struct _mxfer_entry          smx[2], rmx[2];
  extern struct _Ph_ctrl        *_Ph_;

  if (argc > 1)
    gain = atoi(argv[1]);
  else gain = 2;

  if ((ph = PhAttach(NULL, NULL)) == NULL)
    perror("PhAttach");

  conn_id = PhGetConnectId();

  if ((nreg = PhQueryRids(Ph_RIDQUERY_TOWARD, 0, 0, Ph_PTR_REGION,
                  0, 0, NULL, rids, 10)) <0)
    perror("PhQueryRids");

  printf("Found %d ptr regions: %dn", nreg, rids[0]);

  if (PhRegionQuery(rids[0], ®ion, &rect, ®ion_data,
                    sizeof(region_data)) <0)
    perror("PhRegionQuery");

  for(i = 0; i <MAX_DEVS_PER_MGR; i++) {
    if (region_data.info.devices[i].type == _INTERACT_TYPE_POINTER) {
      printf("Found a INTERACT_TYPE_POINTERn");
      break;
    }
  }

  pctrl.type.handle = region_data.info.devices[i].handle;
  pctrl.type.type = region_data.info.devices[i].type;
  pctrl.type.feedback = region_data.info.devices[i].feedback;
  pctrl.gain = gain;
  pctrl.threshold = 0;

  msg.send.forward.hdr.type = _Ph_SERV_POINTER;
  msg.send.forward.hdr.subtype = _POINTERSETCTRL;
  msg.send.forward.pid = region.owner;


  msg.send.forward.len = IOCPARM_LEN(_POINTERSETCTRL);

  _setmx(&smx[0], &msg.send, sizeof(msg.send));
  _setmx(&smx[1], &pctrl, sizeof(pctrl));
  _setmx(&rmx[0], &msg.reply, sizeof(msg.reply));
  _setmx(&rmx[1], &pctrl, sizeof(pctrl));

  if (Sendfdmx(ph->fd, 2, 2, smx, rmx) <0)
    perror("Sendfdmx");

  printf("Message sent successfullyn");
  printf("Result code is %dn", msg.reply.result);

}
 
 
**************

Any ideas?