cue sdk的python包装器

cue_sdk的Python项目详细描述


提示sdk

cue sdk的python包装器

On PyPi

安装

使用pip

$ pip install cue_sdk

用法示例

>>>fromcue_sdkimport*# Load CUE DLL. Provide path to DLL yourself.>>>Corsair=CUESDK("CUESDK.x64_2013.dll")# Gives us exclusive access to controling the lighting and turns everything off.>>>Corsair.RequestControl(CAM.ExclusiveLightingControl)True# Sets the color of the H key to white.>>>Corsair.SetLedsColors(CorsairLedColor(CLK.H,255,255,255))True# Sets the color of the A and B key to green>>>Corsair.SetLedsColors([CorsairLedColor(CLK.A,0,255,0),CorsairLedColor(CLK.B,0,255,0)])True# Define a callback function for SetLedsColorsAsync>>>defexample_callback(context,result,error):...assertcontext=="test123"...print(context,result,error)...# Asynchronously set the color of the E key to white. Pass in a callback and an arbitrary context.>>>Corsair.SetLedsColorsAsync(CorsairLedColor(CLK.E,255,255,255),example_callback,"test123")True# (Note: The >>> appears before the result because it's async.)>>>test123TrueCE.Success# Returns number of Corsair devices.>>>Corsair.GetDeviceCount()1# Takes zero-based index of device and returns a namedtuple with the device info.>>>Corsair.GetDeviceInfo(0)CorsairDeviceInfo(type=<CDT.Keyboard:2>,model='K70 RGB',physicalLayout=<CPL.US:1>,logicalLayout=<CLL.NA:2>,capsMask=<CDC.Lighting:1>)# Returns a named tuple with the led positions + count of the keyboard.>>>Corsair.GetLedPositions(0)CorsairLedPositions(numberOfLed=111,pLedPosition=(CorsairLedPosition(ledId=<CLK.Escape:1>,top=29.0,left=7.0,height=13.0,width=13.0),...))# Returns the led id (CLK enum) for the key name. Relative to logical layout (e.g. on an AZERTY keyboard it will return Q, not A)>>>Corsair.GetLedIdForKeyName('a')<CLK.A:38># Performs protocol handshake and returns details. Already called when the CUE class is initialized, no need to call for it yourself.>>>Corsair.PerformProtocolHandshake()CorsairProtocolDetails(sdkVersion='1.15.28',serverVersion='1.16.42',sdkProtocolVersion=2,serverProtocolVersion=2,breakingChanges=False)# Protocol details are stored here when called handshake is performed on init.>>>Corsair.ProtocolDetailsCorsairProtocolDetails(sdkVersion='1.15.28',serverVersion='1.16.42',sdkProtocolVersion=2,serverProtocolVersion=2,breakingChanges=False)# Release control back to CUE.>>>Corsair.ReleaseControl(CAM.ExclusiveLightingControl)True

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
泛型Java将参数约束到公共超类   java Spring引导:在构造函数中加载属性文件并用作autowire注释   java中的优先级队列顺序错误。util。优先级队列和特定比较器   带有Java Sprint引导REST的Google应用程序引擎标准在GCLOUD服务器中不起作用   安卓从Java代码中检索变量并将其作为参数分配给TestNG   用于读取列表值的Java JSON对象   java Hibernate映射:实体映射中的重复列   多线程。start()不从Java中的父线程分派   java Android facebook webdialog网络错误(netstack:lib_mgr错误)   http使用Java阻止网站   java DynamicAsper:访问连接报表中动态列的值   java如何分离文件中的每个单词,并在表中显示每个单词和每个单词的编号?   如何打包和部署EclipseJava应用程序?   java使用Mule Anypoint,我想实现没有flowref的功能   java Kafka consumer ClassNotFoundException   java错误捕获帮助;消息不断重复   javaspring,Thymeleaf和CSS如何给错误着色   javascript如何在java中实现反向ajax   如何通过UDP连接从java数据包中读取序列号?