src/video/win32/SDL_win32mouse.c
changeset 2990 502adab079a4
parent 2980 8789e4b0e0e7
child 3097 0d12e8f1de3c
equal deleted inserted replaced
2989:aba5a5cc2e63 2990:502adab079a4
    83         if (GetRawInputDeviceInfoA
    83         if (GetRawInputDeviceInfoA
    84             (deviceList[i].hDevice, RIDI_DEVICENAME, NULL, &tmp) < 0) {
    84             (deviceList[i].hDevice, RIDI_DEVICENAME, NULL, &tmp) < 0) {
    85             continue;
    85             continue;
    86         }
    86         }
    87         buffer = SDL_malloc((tmp + 1) * sizeof(char));
    87         buffer = SDL_malloc((tmp + 1) * sizeof(char));
    88         key_name = SDL_malloc((tmp + SDL_strlen(reg_key_root) + 1) * sizeof(char));
    88         key_name =
       
    89             SDL_malloc((tmp + SDL_strlen(reg_key_root) + 1) * sizeof(char));
    89 
    90 
    90         /* we're getting the device registry path and polishing it to get it's name,
    91         /* we're getting the device registry path and polishing it to get it's name,
    91            surely there must be an easier way, but we haven't found it yet */
    92            surely there must be an easier way, but we haven't found it yet */
    92         if (GetRawInputDeviceInfoA
    93         if (GetRawInputDeviceInfoA
    93             (deviceList[i].hDevice, RIDI_DEVICENAME, buffer, &tmp) < 0) {
    94             (deviceList[i].hDevice, RIDI_DEVICENAME, buffer, &tmp) < 0) {
   124                     break;
   125                     break;
   125                 }
   126                 }
   126             }
   127             }
   127         }
   128         }
   128 
   129 
   129 		buffer -= 4;
   130         buffer -= 4;
   130 
   131 
   131         if (is_rdp == 1) {
   132         if (is_rdp == 1) {
   132             SDL_free(buffer);
   133             SDL_free(buffer);
   133             SDL_free(key_name);
   134             SDL_free(key_name);
   134             SDL_free(device_name);
   135             SDL_free(device_name);
   176         if (tablet == index) {
   177         if (tablet == index) {
   177             AXIS pressure;
   178             AXIS pressure;
   178             int cursors;
   179             int cursors;
   179             data->WTInfoA(WTI_DEVICES, DVC_NPRESSURE, &pressure);
   180             data->WTInfoA(WTI_DEVICES, DVC_NPRESSURE, &pressure);
   180             data->WTInfoA(WTI_DEVICES, DVC_NCSRTYPES, &cursors);
   181             data->WTInfoA(WTI_DEVICES, DVC_NCSRTYPES, &cursors);
   181             SDL_AddMouse(&mouse, device_name, pressure.axMax, pressure.axMin, cursors);
   182             SDL_AddMouse(&mouse, device_name, pressure.axMax, pressure.axMin,
       
   183                          cursors);
   182         } else {
   184         } else {
   183             SDL_AddMouse(&mouse, device_name, 0, 0, 1);
   185             SDL_AddMouse(&mouse, device_name, 0, 0, 1);
   184         }
   186         }
   185         ++index;
   187         ++index;
   186         SDL_free(buffer);
   188         SDL_free(buffer);