*** empty log message ***

This commit is contained in:
Elias Naur 2003-10-23 18:21:56 +00:00
parent 51f053e664
commit 86cedb9425
3 changed files with 16 additions and 11 deletions

View File

@ -196,7 +196,7 @@ static bool LoadOpenAL(JNIEnv *env, jobjectArray oalPaths) {
jsize pathcount = env->GetArrayLength(oalPaths); jsize pathcount = env->GetArrayLength(oalPaths);
#ifdef _DEBUG #ifdef _DEBUG
printf("Found %d OpenAL paths\n", pathcount); printf("Found %d OpenAL paths\n", (int)pathcount);
#endif #endif
for(int i=0;i<pathcount;i++) { for(int i=0;i<pathcount;i++) {
jstring path = (jstring) env->GetObjectArrayElement(oalPaths, i); jstring path = (jstring) env->GetObjectArrayElement(oalPaths, i);

View File

@ -45,7 +45,7 @@
static void searchDictionary(CFDictionaryRef dict, hid_device_t *hid_dev, int num_cookies, hid_cookie_t *hid_cookies); static void searchDictionary(CFDictionaryRef dict, hid_device_t *hid_dev, int num_cookies, hid_cookie_t *hid_cookies);
static void searchObject(CFTypeRef object, hid_device_t *hid_dev, int num_cookies, hid_cookie_t *hid_cookies); static void searchObject(CFTypeRef object, hid_device_t *hid_dev, int num_cookies, hid_cookie_t *hid_cookies);
/*static void printCFString(CFStringRef str) { static void printCFString(CFStringRef str) {
CFIndex buffer_size = CFStringGetLength(str) + 1; CFIndex buffer_size = CFStringGetLength(str) + 1;
char * buffer = (char *)malloc(buffer_size); char * buffer = (char *)malloc(buffer_size);
if (buffer != NULL) { if (buffer != NULL) {
@ -61,21 +61,20 @@ static void printCFNumber(CFNumberRef num) {
if (CFNumberGetValue(num, kCFNumberLongType, &number)) if (CFNumberGetValue(num, kCFNumberLongType, &number))
printf("0x%lx (%ld)", number, number); printf("0x%lx (%ld)", number, number);
} }
*/
/*static void printProperty(CFDictionaryRef dict, CFStringRef key) {
static void printProperty(CFDictionaryRef dict, CFStringRef key) {
CFTypeRef val = CFDictionaryGetValue(dict, key); CFTypeRef val = CFDictionaryGetValue(dict, key);
if (val != NULL) { if (val != NULL) {
CFTypeID type = CFGetTypeID(val); CFTypeID type = CFGetTypeID(val);
if (type == CFArrayGetTypeID()) printf("array\n"); /* if (type == CFArrayGetTypeID()) printf("array\n");
else if (type == CFBooleanGetTypeID()) printf("boolean\n"); else if (type == CFBooleanGetTypeID()) printf("boolean\n");
else if (type == CFDictionaryGetTypeID()) printf("dictionary\n"); else if (type == CFDictionaryGetTypeID()) printf("dictionary\n");
else if (type == CFNumberGetTypeID()) printCFNumber((CFNumberRef)val); else*/ if (type == CFNumberGetTypeID()) printCFNumber((CFNumberRef)val);
else if (type == CFStringGetTypeID()) printCFString((CFStringRef)val); else if (type == CFStringGetTypeID()) printCFString((CFStringRef)val);
else printf("<unknown object type>\n"); else printf("<unknown object type>\n");
} }
} }
*/
static void closeDeviceAndQueue(hid_device_t *hid_dev) { static void closeDeviceAndQueue(hid_device_t *hid_dev) {
(*hid_dev->device_queue)->dispose(hid_dev->device_queue); (*hid_dev->device_queue)->dispose(hid_dev->device_queue);
@ -205,9 +204,15 @@ bool findDevice(hid_device_t *hid_dev, long device_usage_page, long device_usage
long usage; long usage;
long usage_page; long usage_page;
if (getDictLong(dev_props, CFSTR(kIOHIDPrimaryUsageKey), &usage) && if (getDictLong(dev_props, CFSTR(kIOHIDPrimaryUsageKey), &usage) &&
getDictLong(dev_props, CFSTR(kIOHIDPrimaryUsagePageKey), &usage_page) && getDictLong(dev_props, CFSTR(kIOHIDPrimaryUsagePageKey), &usage_page)) {
usage_page == device_usage_page && usage == device_usage) { #ifdef _DEBUG
success = initDevice(hid_dev, hid_device, dev_props, num_cookies, hid_cookies, buffer_size); printf("Considering device '");
printProperty(dev_props, CFSTR(kIOHIDProductKey));
printf("', usage page %ld usage %ld\n", usage_page, usage);
#endif
if (usage_page == device_usage_page && usage == device_usage) {
success = initDevice(hid_dev, hid_device, dev_props, num_cookies, hid_cookies, buffer_size);
}
} }
CFRelease(dev_props); CFRelease(dev_props);
} }

View File

@ -164,7 +164,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate(JNIEnv * env, jclass c
hid_cookies[z_axis_index].usage_page = kHIDPage_GenericDesktop; hid_cookies[z_axis_index].usage_page = kHIDPage_GenericDesktop;
hid_cookies[z_axis_index].usage = kHIDUsage_GD_Wheel; hid_cookies[z_axis_index].usage = kHIDUsage_GD_Wheel;
if (!findDevice(&hid_dev, kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse, NUM_COOKIES, hid_cookies, EVENT_BUFFER_SIZE)) { if (!findDevice(&hid_dev, kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse, NUM_COOKIES, hid_cookies, EVENT_BUFFER_SIZE)) {
throwException(env, "Could not find HID muse device"); throwException(env, "Could not find HID mouse device");
return; return;
} }
CGAssociateMouseAndMouseCursorPosition(FALSE); CGAssociateMouseAndMouseCursorPosition(FALSE);