Import Upstream version 1.2.7

This commit is contained in:
Giacomo Catenazzi committed 2019-04-29 15:39:29 +02:00
1 parent fd6a5d112b
commit 862c94c485
17 files changed
+1311 -805

No files matched your search

+4 -9
View File
@@ -17,7 +17,7 @@
(c) 2006-2007 The G15tools Project - g15tools.sf.net
$Revision: 282 $ - $Date: 2008-01-20 06:32:00 +1030 (Sun, 20 Jan 2008) $ $Author: mlampard $
$Revision: 292 $ - $Date: 2008-11-11 08:51:25 -0500 (Tue, 11 Nov 2008) $ $Author: aneurysm9 $
*/
#include <pthread.h>
@@ -765,13 +765,13 @@ static void processKeyEvent5Byte(unsigned int *pressed_keys, unsigned char *buff
int getPressedKeys(unsigned int *pressed_keys, unsigned int timeout)
{
unsigned char buffer[9];
unsigned char buffer[G15_KEY_READ_LENGTH];
int ret = 0;
#ifdef LIBUSB_BLOCKS
ret = usb_interrupt_read(keyboard_device, g15_keys_endpoint, (char*)buffer, 9, timeout);
ret = usb_interrupt_read(keyboard_device, g15_keys_endpoint, (char*)buffer, G15_KEY_READ_LENGTH, timeout);
#else
pthread_mutex_lock(&libusb_mutex);
ret = usb_interrupt_read(keyboard_device, g15_keys_endpoint, (char*)buffer, 9, timeout);
ret = usb_interrupt_read(keyboard_device, g15_keys_endpoint, (char*)buffer, G15_KEY_READ_LENGTH, timeout);
pthread_mutex_unlock(&libusb_mutex);
#endif
if(ret>0) {
@@ -779,11 +779,6 @@ int getPressedKeys(unsigned int *pressed_keys, unsigned int timeout)
return G15_ERROR_TRY_AGAIN;
}
if(g15DeviceCapabilities() & G15_DEVICE_5BYTE_RETURN) {
processKeyEvent5Byte(pressed_keys, buffer);
return G15_NO_ERROR;
}
switch(ret) {
case 5:
processKeyEvent5Byte(pressed_keys, buffer);