gyro
NepEgor 2 years ago
parent e26b2900f5
commit b120ad07ee

@ -3,7 +3,7 @@
#include "touch_joystick.h" #include "touch_joystick.h"
class TouchMouseJoustick : public TouchJoystick class TouchMouseJoystick : public TouchJoystick
{ {
protected: protected:

@ -2,7 +2,7 @@
#include <math.h> #include <math.h>
void TouchMouseJoustick::init(int32_t pos_x, int32_t pos_y, int32_t pos_r, int16_t usb_x, int16_t usb_y, int16_t usb_r) void TouchMouseJoystick::init(int32_t pos_x, int32_t pos_y, int32_t pos_r, int16_t usb_x, int16_t usb_y, int16_t usb_r)
{ {
TouchJoystick::init(pos_x, pos_y, pos_r, usb_x, usb_y, usb_r); TouchJoystick::init(pos_x, pos_y, pos_r, usb_x, usb_y, usb_r);
@ -17,17 +17,17 @@ void TouchMouseJoustick::init(int32_t pos_x, int32_t pos_y, int32_t pos_r, int16
this->time0 = 0; this->time0 = 0;
} }
void TouchMouseJoustick::setSensitivity(float sensitivity) void TouchMouseJoystick::setSensitivity(float sensitivity)
{ {
this->sensitivity = this->pos2usb * sensitivity; this->sensitivity = this->pos2usb * sensitivity;
} }
void TouchMouseJoustick::setTrackballFriction(float trackball_friction) void TouchMouseJoystick::setTrackballFriction(float trackball_friction)
{ {
this->trackball_friction = trackball_friction; this->trackball_friction = trackball_friction;
} }
int8_t TouchMouseJoustick::touch(int8_t fid, int32_t tx, int32_t ty, int32_t tdx, int32_t tdy, uint32_t time) int8_t TouchMouseJoystick::touch(int8_t fid, int32_t tx, int32_t ty, int32_t tdx, int32_t tdy, uint32_t time)
{ {
if (finger_id != -1 && finger_id != fid) if (finger_id != -1 && finger_id != fid)
{ {
@ -93,7 +93,7 @@ int8_t TouchMouseJoustick::touch(int8_t fid, int32_t tx, int32_t ty, int32_t tdx
return touching; return touching;
} }
void TouchMouseJoustick::updateTrackball(uint32_t time) void TouchMouseJoystick::updateTrackball(uint32_t time)
{ {
if (trackball_friction > 0 && !touching) if (trackball_friction > 0 && !touching)
{ {

@ -9,7 +9,7 @@ namespace InputMapper
{ {
USB_Device device; USB_Device device;
TouchMouseJoustick tjoystick_right; TouchMouseJoystick tjoystick_right;
TouchJoystick tjoystick_left; TouchJoystick tjoystick_left;
TouchDpad tdpad_right; TouchDpad tdpad_right;
TouchDpad tdpad_left; TouchDpad tdpad_left;
@ -200,7 +200,7 @@ namespace InputMapper
case TouchControl::CT_MOUSE_JOYSTICK: case TouchControl::CT_MOUSE_JOYSTICK:
{ {
TouchMouseJoustick* tmjoy = (TouchMouseJoustick*)tcontrols[id][c]; TouchMouseJoystick* tmjoy = (TouchMouseJoystick*)tcontrols[id][c];
res = tmjoy->touch(fid, x, y, dx, dy, time); res = tmjoy->touch(fid, x, y, dx, dy, time);
@ -241,7 +241,7 @@ namespace InputMapper
{ {
case TouchControl::CT_MOUSE_JOYSTICK: case TouchControl::CT_MOUSE_JOYSTICK:
{ {
TouchMouseJoustick* tmjoy = (TouchMouseJoustick*)tcontrols[id][c]; TouchMouseJoystick* tmjoy = (TouchMouseJoystick*)tcontrols[id][c];
tmjoy->updateTrackball(time); tmjoy->updateTrackball(time);

Loading…
Cancel
Save