Override mouse speed settings. Creating my own mouse speed algorithm

I work with children with disabilities who have cerebral palsy. One child has limited subtle motor control, so she currently uses a joystick to control the mouse, and its movement speed is very low. This works well for her because she can click all the buttons on the screen, but I think we could do better - when she wants to go through the entire screen, it takes an age (about 10 seconds).

My hypothesis is that her brain is beautiful, and only her motor control is poor. If this is true, I believe that a mouse that started at a low speed but experienced constant acceleration would be better for her, as she could accelerate her speed and become faster by going through the entire screen. If this works, then we can configure PID control and speed / acceleration settings for a large number of people with disabilities, speed up their access and, therefore, their training and development.

But I do not know how best to build it - all suggestions, thoughts, links and tips are welcome.

To begin with, I tried using Processing and Java, and using mouseListener and Robot to control the cursor. I'm not sure if this is the best way, although when I read the position of the cursor and then write to it, so my best attempts will still make the cursor jump and there is no smooth movement. Is this possible in Java? Do I need to read USB input using some kind of driver, and then replace the cursor on the screen with my own?

I made a couple of videos to illustrate the effect I'm trying to make.

Status quo (my illustration moves the cursor away from the arrow keys) http://www.youtube.com/watch?v=3ZhQCg5DJt8

The new behavior I want (mouse accelerates) http://www.youtube.com/watch?v=JcBK_ZCFGPs

, , , :

- :

import java.awt.AWTException;
import jav
a.awt.Robot;

Robot robot;
int i = 0;
int j = 0;

void setup() {
  setupDotgame();
  try { 
    robot = new Robot();
  } 
  catch (AWTException e) {
    e.printStackTrace();
  }
  robot.mouseMove(screenWidth/2, screenHeight/2);
}

void draw() {
  //println(frameCount);
  robot.mouseMove(screenWidth/2+8*i, screenHeight/2+8*j);
  drawDotgame();
}

void keyPressed() {
  if (keyCode == UP) {
    j--;
  } 
  else if (keyCode == DOWN) {
    j++;
  }
  else if (keyCode == RIGHT) {
    i++;
  }
  else if (keyCode == LEFT) {
    i--;
  }
}

:

import java.awt.AWTException;
import java.awt.Robot;

Robot robot;
int i = 0;
int j = 0;
int delta = 8;
int time = 0;

void setup() {
  setupDotgame();
  try { 
    robot = new Robot();
  } 
  catch (AWTException e) {
    e.printStackTrace();
  }
  robot.mouseMove(screenWidth/2, screenHeight/2);
}

void draw() {



  //println(frameCount);
  robot.mouseMove(screenWidth/2+i, screenHeight/2+j);
  drawDotgame();

}

void keyPressed() {
  if (millis() - time < 90) {
    delta += 8;
  }
  else { delta = 8; }
  time = millis();


  if (keyCode == UP) {
    j-=delta;
  } 
  else if (keyCode == DOWN) {
    j+=delta;
  }
  else if (keyCode == RIGHT) {
    i+=delta;
  }
  else if (keyCode == LEFT) {
    i-=delta;
  }
}

DotGame, :

void setupDotgame() {
  size(1000, 600);
  background(255);
  fill(255, 0, 0);
  noStroke();
  smooth();
  drawCircle();
}

void drawDotgame() {
  if (get(mouseX, mouseY) != color(255)) {
    background(255);
    drawCircle();
  }
}

void drawCircle() {
  int x = round(random(50, width-50));
  int y = round(random(50, height-50));
  int rad = round(random(20, 80));
  ellipse(x, y, rad, rad);
}

+5
1

, , , , , - , , , .

, , AutoItv3, . , , , .

HotKeySet, MouseMove Func/EndFunc.

0

All Articles