This commit is contained in:
NepEgor 2022-05-04 22:55:45 +06:00
parent e26b2900f5
commit b120ad07ee
3 changed files with 9 additions and 9 deletions

View File

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

View File

@ -2,7 +2,7 @@
#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);
@ -17,17 +17,17 @@ void TouchMouseJoustick::init(int32_t pos_x, int32_t pos_y, int32_t pos_r, int16
this->time0 = 0;
}
void TouchMouseJoustick::setSensitivity(float sensitivity)
void TouchMouseJoystick::setSensitivity(float sensitivity)
{
this->sensitivity = this->pos2usb * sensitivity;
}
void TouchMouseJoustick::setTrackballFriction(float trackball_friction)
void TouchMouseJoystick::setTrackballFriction(float 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)
{
@ -93,7 +93,7 @@ int8_t TouchMouseJoustick::touch(int8_t fid, int32_t tx, int32_t ty, int32_t tdx
return touching;
}
void TouchMouseJoustick::updateTrackball(uint32_t time)
void TouchMouseJoystick::updateTrackball(uint32_t time)
{
if (trackball_friction > 0 && !touching)
{

View File

@ -9,7 +9,7 @@ namespace InputMapper
{
USB_Device device;
TouchMouseJoustick tjoystick_right;
TouchMouseJoystick tjoystick_right;
TouchJoystick tjoystick_left;
TouchDpad tdpad_right;
TouchDpad tdpad_left;
@ -200,7 +200,7 @@ namespace InputMapper
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);
@ -241,7 +241,7 @@ namespace InputMapper
{
case TouchControl::CT_MOUSE_JOYSTICK:
{
TouchMouseJoustick* tmjoy = (TouchMouseJoustick*)tcontrols[id][c];
TouchMouseJoystick* tmjoy = (TouchMouseJoystick*)tcontrols[id][c];
tmjoy->updateTrackball(time);