Exemplo n.º 1
0
 def _get_elements(self):
     cfarray = c_void_p(iokit.IOHIDDeviceCopyMatchingElements(self.deviceRef, None, 0))
     if not cfarray:
         # requires "Security & Privacy / Input Monitoring", see #95
         return []
     elements = cfarray_to_list(cfarray)
     cf.CFRelease(cfarray)
     return elements
Exemplo n.º 2
0
 def get_modes(self):
     cgmodes = c_void_p(
         quartz.CGDisplayCopyAllDisplayModes(self._cg_display_id, None))
     modes = [
         CocoaScreenMode(self, cgmode)
         for cgmode in cfarray_to_list(cgmodes)
     ]
     cf.CFRelease(cgmodes)
     return modes
Exemplo n.º 3
0
 def _get_elements(self):
     try:
         cfarray = c_void_p(
             iokit.IOHIDDeviceCopyMatchingElements(self.deviceRef, None, 0))
         elements = cfarray_to_list(cfarray)
         cf.CFRelease(cfarray)
     except:
         return []
     return elements
Exemplo n.º 4
0
 def get_elements(self):
     cfarray = c_void_p(
         iokit.IOHIDDeviceCopyMatchingElements(self.deviceRef, None, 0))
     self.elements = cfarray_to_list(cfarray)
     cf.CFRelease(cfarray)