iokit

IOHIDEventSystemCreate on iOS6 failed

家住魔仙堡 提交于 2019-12-01 00:06:38
IOHIDEventSystemCreate always return NULL on iOS6 (work fine on iOS5). Anyone know why? Example on iPhoneDevWiki #include <IOKit/hid/IOHIDEventSystem.h> #include <stdio.h> void handle_event (void* target, void* refcon, IOHIDServiceRef service, IOHIDEventRef event) { // handle the events here. printf("Received event of type %2d from service %p.\n", IOHIDEventGetType(event), service); } int main () { // Create and open an event system. IOHIDEventSystemRef system = IOHIDEventSystemCreate(NULL); IOHIDEventSystemOpen(system, handle_event, NULL, NULL, NULL); printf("HID Event system should now be

High resolution and high framerate mouse coordinates on OSX? (Or other solution?)

流过昼夜 提交于 2019-11-30 15:13:43
问题 I'd like to get mouse movements in high resolution and high framerate on OSX. "High framerate" = 60 fps or higher (preferably > 120) "High resolution" = Subpixel values Problem I've got an opengl view running at about the monitor refresh rate, so it's ~60 fps. I use the mouse to look around, so I've hidden the mouse cursor and I'm relying on mouse delta values. The problem is the mouse events come in at much too low framerate, and values are snapped to integer (whole pixels). This causes a

High resolution and high framerate mouse coordinates on OSX? (Or other solution?)

自闭症网瘾萝莉.ら 提交于 2019-11-30 13:55:57
I'd like to get mouse movements in high resolution and high framerate on OSX. "High framerate" = 60 fps or higher (preferably > 120) "High resolution" = Subpixel values Problem I've got an opengl view running at about the monitor refresh rate, so it's ~60 fps. I use the mouse to look around, so I've hidden the mouse cursor and I'm relying on mouse delta values. The problem is the mouse events come in at much too low framerate, and values are snapped to integer (whole pixels). This causes a "choppy" viewing experience. Here's a visualization of mouse delta values over time: mouse delta X ^ xx 2

How to get serial number of a device using IOKit in iOS8 as IOPlatformSerialNumber giving nil value

笑着哭i 提交于 2019-11-30 10:54:15
I was wondered to know how to get serial number of a device using IOKit in iOS8? I used UIDevice+serialNumber and I am able to get serial number in iOS6 and7. In iOS8 value of platformSerialNumber is coming nil in the following line: CFTypeRef platformSerialNumber = IORegistryEntryCreateCFProperty(platformExpertDevice,CFSTR("IOPlatformSerialNumber"), kCFAllocatorDefault, 0); I am using : https://gist.github.com/0xced/566994 Note:My app will not go to app store, its for inhouse. So I am looking for something more concrete that will never change, either String or integer Starting in iOS 8,

How to tap/hook keyboard events in OSX and record which keyboard fires each event

為{幸葍}努か 提交于 2019-11-30 09:14:43
问题 I've now discovered how to hook/tap keyboard events on OS X at a low level: How to tap (hook) F7 through F12 and Power/Eject on a MacBook keyboard Printing out the code from that answer: // compile and run from the commandline with: // clang -framework coreFoundation -framework IOKit ./HID.c -o hid // sudo ./hid // This code works with the IOHID library to get notified of keys. // Still haven't figured out how to truly intercept with // substitution. #include <IOKit/hid/IOHIDValue.h> #include

Convert CFString to NSString - Swift

你离开我真会死。 提交于 2019-11-30 01:20:50
问题 I'm trying to write a program that will scan for available serial ports and present them in a popup menu. Why can I not take the CFString straight from the IORegistryEntryCreateCFProperty() function and add it to the menu via string interpolation in the next line? For some reason my variable declaration is met with the error: "NSString is not a subtype of CFString". import Foundation import Cocoa import IOKit import IOKit.serial @objc class Serial { init() { } @IBOutlet var serialListPullDown

How to create a program to list all the USB devices in a Mac?

情到浓时终转凉″ 提交于 2019-11-30 00:16:27
I have a limited exposure to the Mac OS X operating system and now I have started using Xcode and am studying about I/O kit. I need to create a program in Xcode under command line tool in order to list all USB devices connected in a Mac system. Those who have previous experience under this, please help me. If anyone could provide me with sample code then it will be of great use, as I am looking for starting point. Hasturkun You can adapt USBPrivateDataSample to your needs, the sample sets up a notifier, lists the currently attached devices, then waits for device attach/detach. If you do, you

How to get serial number of a device using IOKit in iOS8 as IOPlatformSerialNumber giving nil value

橙三吉。 提交于 2019-11-29 15:45:05
问题 I was wondered to know how to get serial number of a device using IOKit in iOS8? I used UIDevice+serialNumber and I am able to get serial number in iOS6 and7. In iOS8 value of platformSerialNumber is coming nil in the following line: CFTypeRef platformSerialNumber = IORegistryEntryCreateCFProperty(platformExpertDevice,CFSTR("IOPlatformSerialNumber"), kCFAllocatorDefault, 0); I am using : https://gist.github.com/0xced/566994 Note:My app will not go to app store, its for inhouse. So I am

How to get CPU temperature and fan speed on OS X?

为君一笑 提交于 2019-11-28 23:00:55
问题 How do I get CPU temperature and fan speeds in OS X? I understand that information is obtained from IOHWSensor in IOKit , but I'm unable to find any reliable information on how to exactly do that. I've found an article with a sample program - http://www.booktou.com/node/148/0321278542/ch10lev1sec7.html, but all I get with it is the GPU temperature. I'm sure there are CPU temperature sensors on the unibody Macs, so that means I'm doing something wrong. 回答1: The source code for this Prefpane

How to create a program to list all the USB devices in a Mac?

随声附和 提交于 2019-11-28 21:17:50
问题 I have a limited exposure to the Mac OS X operating system and now I have started using Xcode and am studying about I/O kit. I need to create a program in Xcode under command line tool in order to list all USB devices connected in a Mac system. Those who have previous experience under this, please help me. If anyone could provide me with sample code then it will be of great use, as I am looking for starting point. 回答1: You can adapt USBPrivateDataSample to your needs, the sample sets up a