mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-06-03 13:58:22 +00:00
Minor cleanup
This commit is contained in:
parent
9cd7cbe134
commit
92fd2938e7
|
@ -552,6 +552,32 @@ static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode)
|
||||||
return scancode;
|
return scancode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int SDL_EVDEV_init_mouse(SDL_evdevlist_item *item, int udev_class)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
struct input_absinfo abs_info;
|
||||||
|
|
||||||
|
ret = ioctl(item->fd, EVIOCGABS(ABS_X), &abs_info);
|
||||||
|
if (ret < 0) {
|
||||||
|
// no absolute mode info, continue
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
item->min_x = abs_info.minimum;
|
||||||
|
item->max_x = abs_info.maximum;
|
||||||
|
item->range_x = abs_info.maximum - abs_info.minimum;
|
||||||
|
|
||||||
|
ret = ioctl(item->fd, EVIOCGABS(ABS_Y), &abs_info);
|
||||||
|
if (ret < 0) {
|
||||||
|
// no absolute mode info, continue
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
item->min_y = abs_info.minimum;
|
||||||
|
item->max_y = abs_info.maximum;
|
||||||
|
item->range_y = abs_info.maximum - abs_info.minimum;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int SDL_EVDEV_init_touchscreen(SDL_evdevlist_item *item, int udev_class)
|
static int SDL_EVDEV_init_touchscreen(SDL_evdevlist_item *item, int udev_class)
|
||||||
{
|
{
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
@ -653,36 +679,6 @@ static int SDL_EVDEV_init_touchscreen(SDL_evdevlist_item *item, int udev_class)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SDL_EVDEV_init_mouse(SDL_evdevlist_item *item, int udev_class)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
struct input_absinfo abs_info;
|
|
||||||
|
|
||||||
if (item->is_touchscreen) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = ioctl(item->fd, EVIOCGABS(ABS_X), &abs_info);
|
|
||||||
if (ret < 0) {
|
|
||||||
// no absolute mode info, continue
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
item->min_x = abs_info.minimum;
|
|
||||||
item->max_x = abs_info.maximum;
|
|
||||||
item->range_x = abs_info.maximum - abs_info.minimum;
|
|
||||||
|
|
||||||
ret = ioctl(item->fd, EVIOCGABS(ABS_Y), &abs_info);
|
|
||||||
if (ret < 0) {
|
|
||||||
// no absolute mode info, continue
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
item->min_y = abs_info.minimum;
|
|
||||||
item->max_y = abs_info.maximum;
|
|
||||||
item->range_y = abs_info.maximum - abs_info.minimum;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void SDL_EVDEV_destroy_touchscreen(SDL_evdevlist_item *item)
|
static void SDL_EVDEV_destroy_touchscreen(SDL_evdevlist_item *item)
|
||||||
{
|
{
|
||||||
if (!item->is_touchscreen) {
|
if (!item->is_touchscreen) {
|
||||||
|
|
Loading…
Reference in a new issue