Add support for mouse drivers that do their own orientation mapping as the display rotation changes.
This commit is contained in:
parent
a3935c653e
commit
3c3bab5d82
2 changed files with 17 additions and 13 deletions
|
@ -66,6 +66,10 @@
|
||||||
#define GINPUT_MOUSE_CLICK_TIME 700
|
#define GINPUT_MOUSE_CLICK_TIME 700
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// true/false - Whether the mouse driver internally handles screen rotation
|
||||||
|
#ifndef GINPUT_MOUSE_NO_ROTATION
|
||||||
|
#define GINPUT_MOUSE_NO_ROTATION FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct MouseReading_t {
|
typedef struct MouseReading_t {
|
||||||
coord_t x, y, z;
|
coord_t x, y, z;
|
||||||
|
|
|
@ -164,22 +164,22 @@ static struct MouseConfig_t {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void get_calibrated_reading(MouseReading *pt) {
|
static void get_calibrated_reading(MouseReading *pt) {
|
||||||
#if GINPUT_MOUSE_NEED_CALIBRATION || GDISP_NEED_CONTROL
|
#if GINPUT_MOUSE_NEED_CALIBRATION || (GDISP_NEED_CONTROL && !GINPUT_MOUSE_NO_ROTATION)
|
||||||
coord_t w, h;
|
coord_t w, h;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
get_raw_reading(pt);
|
get_raw_reading(pt);
|
||||||
|
|
||||||
#if GINPUT_MOUSE_NEED_CALIBRATION || GDISP_NEED_CONTROL
|
|
||||||
w = gdispGGetWidth(MouseConfig.display);
|
|
||||||
h = gdispGGetHeight(MouseConfig.display);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if GINPUT_MOUSE_NEED_CALIBRATION
|
#if GINPUT_MOUSE_NEED_CALIBRATION
|
||||||
_tsTransform(pt, &MouseConfig.caldata);
|
_tsTransform(pt, &MouseConfig.caldata);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_CONTROL
|
#if GINPUT_MOUSE_NEED_CALIBRATION || (GDISP_NEED_CONTROL && !GINPUT_MOUSE_NO_ROTATION)
|
||||||
|
w = gdispGGetWidth(MouseConfig.display);
|
||||||
|
h = gdispGGetHeight(MouseConfig.display);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if GDISP_NEED_CONTROL && !GINPUT_MOUSE_NO_ROTATION
|
||||||
switch(gdispGGetOrientation(MouseConfig.display)) {
|
switch(gdispGGetOrientation(MouseConfig.display)) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue