本文整理匯總了Python中Xlib.ext.record.AllClients方法的典型用法代碼示例。如果您正苦於以下問題:Python record.AllClients方法的具體用法?Python record.AllClients怎麽用?Python record.AllClients使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Xlib.ext.record
的用法示例。
在下文中一共展示了record.AllClients方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: run
# 需要導入模塊: from Xlib.ext import record [as 別名]
# 或者: from Xlib.ext.record import AllClients [as 別名]
def run(self):
# Create a recording context; we only want key and mouse events
self.ctx = self.recordDisplay.record_create_context(
0,
[record.AllClients],
[{
'core_requests': (0, 0),
'core_replies': (0, 0),
'ext_requests': (0, 0, 0, 0),
'ext_replies': (0, 0, 0, 0),
'delivered_events': (0, 0),
'device_events': (X.KeyPress, X.ButtonPress), #X.KeyRelease,
'errors': (0, 0),
'client_started': False,
'client_died': False,
}])
# Enable the context; this only returns after a call to record_disable_context,
# while calling the callback function in the meantime
logger.info("XRecord interface thread starting")
self.recordDisplay.record_enable_context(self.ctx, self.__processEvent)
# Finally free the context
self.recordDisplay.record_free_context(self.ctx)
self.recordDisplay.close()
示例2: run
# 需要導入模塊: from Xlib.ext import record [as 別名]
# 或者: from Xlib.ext.record import AllClients [as 別名]
def run(self):
# Check if the extension is present
if not self.record_dpy.has_extension('RECORD'):
print_err('RECORD extension not found')
sys.exit(1)
r = self.record_dpy.record_get_version(0, 0)
print_err('RECORD extension version {}.{}'.format(
r.major_version,
r.minor_version
))
# Create a recording context; we only want key and mouse events
self.ctx = self.record_dpy.record_create_context(
0,
[record.AllClients],
[{
'core_requests': (0, 0),
'core_replies': (0, 0),
'ext_requests': (0, 0, 0, 0),
'ext_replies': (0, 0, 0, 0),
'delivered_events': (0, 0),
# (X.KeyPress, X.ButtonPress),
'device_events': tuple(self.contextEventMask),
'errors': (0, 0),
'client_started': False,
'client_died': False,
}]
)
# Enable the context; this only returns after a call to record_disable
# context, while calling the callback function in the meantime
self.record_dpy.record_enable_context(self.ctx, self.processevents)
# Finally free the context
self.record_dpy.record_free_context(self.ctx)
示例3: run
# 需要導入模塊: from Xlib.ext import record [as 別名]
# 或者: from Xlib.ext.record import AllClients [as 別名]
def run(self):
# Check if the extension is present
if not self.record_dpy.has_extension("RECORD"):
print ("RECORD extension not found")
sys.exit(1)
r = self.record_dpy.record_get_version(0, 0)
print ("RECORD extension version %d.%d" % (r.major_version, r.minor_version))
# Create a recording context; we only want key and mouse events
self.ctx = self.record_dpy.record_create_context(
0,
[record.AllClients],
[{
'core_requests': (0, 0),
'core_replies': (0, 0),
'ext_requests': (0, 0, 0, 0),
'ext_replies': (0, 0, 0, 0),
'delivered_events': (0, 0),
'device_events': tuple(self.contextEventMask), #(X.KeyPress, X.ButtonPress),
'errors': (0, 0),
'client_started': False,
'client_died': False,
}])
# Enable the context; this only returns after a call to record_disable_context,
# while calling the callback function in the meantime
self.record_dpy.record_enable_context(self.ctx, self.processevents)
# Finally free the context
self.record_dpy.record_free_context(self.ctx)
示例4: run
# 需要導入模塊: from Xlib.ext import record [as 別名]
# 或者: from Xlib.ext.record import AllClients [as 別名]
def run(self):
# Check if the extension is present
if not self.record_dpy.has_extension("RECORD"):
print("RECORD extension not found", file=sys.stderr)
sys.exit(1)
# r = self.record_dpy.record_get_version(0, 0)
# print("RECORD extension version {major}.{minor}".format(
# major=r.major_version,
# minor=r.minor_version
# ))
# Create a recording context; we only want key and mouse events
self.ctx = self.record_dpy.record_create_context(
0,
[record.AllClients],
[{
'core_requests': (0, 0),
'core_replies': (0, 0),
'ext_requests': (0, 0, 0, 0),
'ext_replies': (0, 0, 0, 0),
'delivered_events': (0, 0),
# (X.KeyPress, X.ButtonPress),
'device_events': tuple(self.contextEventMask),
'errors': (0, 0),
'client_started': False,
'client_died': False,
}])
# Enable the context; this only returns after a call to
# record_disable_context, while calling the callback function in the
# meantime
self.record_dpy.record_enable_context(self.ctx, self.processevents)
# Finally free the context
self.record_dpy.record_free_context(self.ctx)
示例5: run
# 需要導入模塊: from Xlib.ext import record [as 別名]
# 或者: from Xlib.ext.record import AllClients [as 別名]
def run(self):
# Check if the extension is present
if not self.record_dpy.has_extension("RECORD"):
# print "RECORD extension not found"
sys.exit(1)
r = self.record_dpy.record_get_version(0, 0)
# print "RECORD extension version %d.%d" % (r.major_version, r.minor_version)
# Create a recording context; we only want key and mouse events
self.ctx = self.record_dpy.record_create_context(
0,
[record.AllClients],
[{
'core_requests': (0, 0),
'core_replies': (0, 0),
'ext_requests': (0, 0, 0, 0),
'ext_replies': (0, 0, 0, 0),
'delivered_events': (0, 0),
'device_events': tuple(self.contextEventMask), # (X.KeyPress, X.ButtonPress),
'errors': (0, 0),
'client_started': False,
'client_died': False,
}])
# Enable the context; this only returns after a call to record_disable_context,
# while calling the callback function in the meantime
self.record_dpy.record_enable_context(self.ctx, self.processevents)
# Finally free the context
self.record_dpy.record_free_context(self.ctx)
示例6: run
# 需要導入模塊: from Xlib.ext import record [as 別名]
# 或者: from Xlib.ext.record import AllClients [as 別名]
def run(self):
# Check if the extension is present
if not self.record_dpy.has_extension("RECORD"):
print "RECORD extension not found"
sys.exit(1)
r = self.record_dpy.record_get_version(0, 0)
print "RECORD extension version %d.%d" % (r.major_version, r.minor_version)
# Create a recording context; we only want key and mouse events
self.ctx = self.record_dpy.record_create_context(
0,
[record.AllClients],
[{
'core_requests': (0, 0),
'core_replies': (0, 0),
'ext_requests': (0, 0, 0, 0),
'ext_replies': (0, 0, 0, 0),
'delivered_events': (0, 0),
'device_events': tuple(self.contextEventMask), #(X.KeyPress, X.ButtonPress),
'errors': (0, 0),
'client_started': False,
'client_died': False,
}])
# Enable the context; this only returns after a call to record_disable_context,
# while calling the callback function in the meantime
self.record_dpy.record_enable_context(self.ctx, self.processevents)
# Finally free the context
self.record_dpy.record_free_context(self.ctx)
示例7: run
# 需要導入模塊: from Xlib.ext import record [as 別名]
# 或者: from Xlib.ext.record import AllClients [as 別名]
def run(self):
# Check if the extension is present
if not self.record_dpy.has_extension("RECORD"):
print("RECORD extension not found")
sys.exit(1)
r = self.record_dpy.record_get_version(0, 0)
print("RECORD extension version %d.%d" % (r.major_version, r.minor_version))
# Create a recording context; we only want key and mouse events
self.ctx = self.record_dpy.record_create_context(
0,
[record.AllClients],
[{
'core_requests': (0, 0),
'core_replies': (0, 0),
'ext_requests': (0, 0, 0, 0),
'ext_replies': (0, 0, 0, 0),
'delivered_events': (0, 0),
'device_events': tuple(self.contextEventMask), #(X.KeyPress, X.ButtonPress),
'errors': (0, 0),
'client_started': False,
'client_died': False,
}])
# Enable the context; this only returns after a call to record_disable_context,
# while calling the callback function in the meantime
self.record_dpy.record_enable_context(self.ctx, self.processevents)
# Finally free the context
self.record_dpy.record_free_context(self.ctx)
示例8: run
# 需要導入模塊: from Xlib.ext import record [as 別名]
# 或者: from Xlib.ext.record import AllClients [as 別名]
def run(self):
# Check if the extension is present
if not self.record_dpy.has_extension("RECORD"):
print "RECORD extension not found"
sys.exit(1)
r = self.record_dpy.record_get_version(0, 0)
#print "RECORD extension version %d.%d" % (r.major_version, r.minor_version)
# Create a recording context; we only want key and mouse events
self.ctx = self.record_dpy.record_create_context(
0,
[record.AllClients],
[{
'core_requests': (0, 0),
'core_replies': (0, 0),
'ext_requests': (0, 0, 0, 0),
'ext_replies': (0, 0, 0, 0),
'delivered_events': (0, 0),
'device_events': tuple(self.contextEventMask), #(X.KeyPress, X.ButtonPress),
'errors': (0, 0),
'client_started': False,
'client_died': False,
}])
# Enable the context; this only returns after a call to record_disable_context,
# while calling the callback function in the meantime
self.record_dpy.record_enable_context(self.ctx, self.processevents)
# Finally free the context
self.record_dpy.record_free_context(self.ctx)