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:
committed by
virtuoussin13
parent
85dfc3ee90
commit
e7f4dfa748
22
src/axis.h
22
src/axis.h
@ -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;
|
||||
|
Reference in New Issue
Block a user