예제 #1
0
	def setDeviceRepeat(self, device, value): # REP_PERIOD
		if self.getDeviceAttribute(device, "enabled"):
			# print("[InputDevices] setDeviceRepeat for device %s to %d ms" % (device, value))
			event = pack("LLHHi", 0, 0, 0x14, 0x01, int(value))
			fd = osopen("/dev/input/%s" % device, O_RDWR)
			oswrite(fd, event)
			osclose(fd)
예제 #2
0
 def setDeviceDelay(self, device, value):  # REP_DELAY
     if self.getDeviceAttribute(device, 'enabled'):
         # print("[InputDevices] setDeviceDelay for device %s to %d ms" % (device, value))
         event = pack('LLHHi', 0, 0, 0x14, 0x00, int(value))
         fd = osopen("/dev/input/" + device, O_RDWR)
         oswrite(fd, event)
         osclose(fd)
	def setDeviceDelay(self, device, value):  # REP_DELAY
		if self.getDeviceAttribute(device, "enabled"):
			# print("[InputDevice] setDeviceDelay DEBUG: Set device '%s' to %s ms." % (device, value))
			event = pack("LLHHi", 0, 0, 0x14, 0x00, int(value))
			fd = osopen("/dev/input/%s" % device, O_RDWR)
			oswrite(fd, event)
			osclose(fd)
예제 #4
0
	def setDeviceDefaults(self, device):
		print("[InputDevice] setDeviceDefaults DEBUG: Device '%s'." % device)
		self.setDeviceAttribute(device, "configuredName", None)
		eventRepeat = pack("LLHHi", 0, 0, 0x14, 0x01, 100)
		eventDelay = pack("LLHHi", 0, 0, 0x14, 0x00, 700)
		fd = osopen("/dev/input/%s" % device, O_RDWR)
		oswrite(fd, eventRepeat)
		oswrite(fd, eventDelay)
		osclose(fd)