adds in advanced gradient control to axis code (thanks to Yue Shi Lai)

git-svn-id: svn://svn.code.sf.net/p/qjoypad/code/trunk@116 c05e91a0-76c8-4ec0-b377-ef19ce7cc080
This commit is contained in:
John Toman
2009-09-16 03:51:40 +00:00
committed by virtuoussin13
parent 85dfc3ee90
commit e7f4dfa748
5 changed files with 143 additions and 44 deletions

View File

@ -3,6 +3,7 @@
//abs()
#include <stdlib.h>
#include <math.h>
#include <QTimer>
#include <QTextStream>
@ -16,6 +17,8 @@
//each axis can create a key press or move the mouse in one of four directions.
enum AxisMode {keybd, mousepv, mousenv, mouseph, mousenh};
enum TransferCurve {linear, quadratic, cubic, quadratic_extreme,
power_function};
//represents one joystick axis
class Axis : public QObject {
@ -65,14 +68,17 @@ class Axis : public QObject {
bool isDown;
//variables for calculating quadratic used for gradient mouse axes
double a,b,c;
//actual axis settings:
bool gradient;
int maxSpeed; //0..MAXMOUSESPEED
int throttle; //-1 (nkey), 0 (no throttle), 1 (pkey)
int dZone;//-32767 .. 32767
int xZone;//-32767 .. 32767
float inverseRange;
//actual axis settings:
bool gradient;
int maxSpeed; //0..MAXMOUSESPEED
unsigned int transferCurve;
float sensitivity;
int throttle; //-1 (nkey), 0 (no throttle), 1 (pkey)
int dZone;//-32767 .. 32767
int xZone;//-32767 .. 32767
double sumDist;
AxisMode mode;
//positive keycode
int pkeycode;