├── docs ├── images │ └── states.png ├── styles │ └── styles.css └── index.html ├── src └── include │ ├── iCUESDKGlobal.h │ ├── iCUESDKLedIdEnum.h │ └── iCUESDK.h ├── README.md └── .gitignore /docs/images/states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CorsairOfficial/cue-sdk/HEAD/docs/images/states.png -------------------------------------------------------------------------------- /src/include/iCUESDKGlobal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef _LIB 4 | # if defined(_WIN32) || defined(WIN32) 5 | # if defined(CORSAIR_ICUE_SDK_DLL) || defined(ICUESDK_EXPORTS) 6 | # define CORSAIR_ICUE_SDK_EXPORT __declspec(dllexport) 7 | # else 8 | # define CORSAIR_ICUE_SDK_EXPORT __declspec(dllimport) 9 | # endif 10 | # else 11 | # define CORSAIR_ICUE_SDK_EXPORT __attribute__((visibility("default"))) 12 | # endif // WIN32 13 | #else 14 | # define CORSAIR_ICUE_SDK_EXPORT 15 | #endif // !_LIB 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The official iCUE SDK for C/C++ 2 | 3 | This repository is for iCUE SDK releases and documentation. 4 | 5 | Developers can use the iCUE SDK to access CORSAIR devices, enabling them to control device LEDs and create custom lighting experiences. 6 | 7 | ## Want to partner with us? 8 | 9 | We can offer marketing support and other event based SDKs on iCUE integrations for games and other select software. 10 | 11 | To learn more, please contact us on the iCUE Dev page: https://www.corsair.com/icue-dev 12 | 13 | ## Resources 14 | 15 | - Download the latest iCUE SDK release: https://github.com/CorsairOfficial/cue-sdk/releases 16 | - Read the full API reference: https://corsairofficial.github.io/cue-sdk 17 | -------------------------------------------------------------------------------- /src/include/iCUESDKLedIdEnum.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum CorsairLedGroup // contains a list of led groups. Led group is used as a part of led identifier 4 | { 5 | CLG_Keyboard = 0, // for keyboard leds 6 | CLG_KeyboardGKeys = 1, // for keyboard leds on G keys 7 | CLG_KeyboardEdge = 2, // for keyboard lighting pipe leds 8 | CLG_KeyboardOem = 3, // for vendor specific keyboard leds (ProfileSwitch, DialRing, etc.) 9 | CLG_Mouse = 4, // for mouse leds 10 | CLG_Mousemat = 5, // for mousemat leds 11 | CLG_Headset = 6, // for headset leds 12 | CLG_HeadsetStand = 7, // for headset stand leds 13 | CLG_MemoryModule = 8, // for memory module leds 14 | CLG_Motherboard = 9, // for motherboard leds 15 | CLG_GraphicsCard = 10, // for graphics card leds 16 | CLG_DIY_Channel1 = 11, // for leds on the first channel of DIY devices and coolers 17 | CLG_DIY_Channel2 = 12, // for leds on the second channel of DIY devices and coolers 18 | CLG_DIY_Channel3 = 13, // for leds on the third channel of DIY devices and coolers 19 | CLG_Touchbar = 14, // for touchbar leds 20 | CLG_GameController = 15 // for game controller leds 21 | }; 22 | 23 | enum CorsairLedId_Keyboard // contains a list of keyboard leds that belong to CLG_Keyboard group 24 | { 25 | CLK_Invalid = 0, 26 | CLK_Escape = 1, 27 | CLK_F1 = 2, 28 | CLK_F2 = 3, 29 | CLK_F3 = 4, 30 | CLK_F4 = 5, 31 | CLK_F5 = 6, 32 | CLK_F6 = 7, 33 | CLK_F7 = 8, 34 | CLK_F8 = 9, 35 | CLK_F9 = 10, 36 | CLK_F10 = 11, 37 | CLK_F11 = 12, 38 | CLK_F12 = 13, 39 | CLK_GraveAccentAndTilde = 14, 40 | CLK_1 = 15, 41 | CLK_2 = 16, 42 | CLK_3 = 17, 43 | CLK_4 = 18, 44 | CLK_5 = 19, 45 | CLK_6 = 20, 46 | CLK_7 = 21, 47 | CLK_8 = 22, 48 | CLK_9 = 23, 49 | CLK_0 = 24, 50 | CLK_MinusAndUnderscore = 25, 51 | CLK_EqualsAndPlus = 26, 52 | CLK_Backspace = 27, 53 | CLK_Tab = 28, 54 | CLK_Q = 29, 55 | CLK_W = 30, 56 | CLK_E = 31, 57 | CLK_R = 32, 58 | CLK_T = 33, 59 | CLK_Y = 34, 60 | CLK_U = 35, 61 | CLK_I = 36, 62 | CLK_O = 37, 63 | CLK_P = 38, 64 | CLK_BracketLeft = 39, 65 | CLK_BracketRight = 40, 66 | CLK_CapsLock = 41, 67 | CLK_A = 42, 68 | CLK_S = 43, 69 | CLK_D = 44, 70 | CLK_F = 45, 71 | CLK_G = 46, 72 | CLK_H = 47, 73 | CLK_J = 48, 74 | CLK_K = 49, 75 | CLK_L = 50, 76 | CLK_SemicolonAndColon = 51, 77 | CLK_ApostropheAndDoubleQuote = 52, 78 | CLK_Backslash = 53, 79 | CLK_Enter = 54, 80 | CLK_LeftShift = 55, 81 | CLK_NonUsBackslash = 56, 82 | CLK_Z = 57, 83 | CLK_X = 58, 84 | CLK_C = 59, 85 | CLK_V = 60, 86 | CLK_B = 61, 87 | CLK_N = 62, 88 | CLK_M = 63, 89 | CLK_CommaAndLessThan = 64, 90 | CLK_PeriodAndBiggerThan = 65, 91 | CLK_SlashAndQuestionMark = 66, 92 | CLK_RightShift = 67, 93 | CLK_LeftCtrl = 68, 94 | CLK_LeftGui = 69, 95 | CLK_LeftAlt = 70, 96 | CLK_Space = 71, 97 | CLK_RightAlt = 72, 98 | CLK_RightGui = 73, 99 | CLK_Application = 74, 100 | CLK_RightCtrl = 75, 101 | CLK_LedProgramming = 76, 102 | CLK_Lang1 = 77, 103 | CLK_Lang2 = 78, 104 | CLK_International1 = 79, 105 | CLK_International2 = 80, 106 | CLK_International3 = 81, 107 | CLK_International4 = 82, 108 | CLK_International5 = 83, 109 | CLK_PrintScreen = 84, 110 | CLK_ScrollLock = 85, 111 | CLK_PauseBreak = 86, 112 | CLK_Insert = 87, 113 | CLK_Home = 88, 114 | CLK_PageUp = 89, 115 | CLK_Delete = 90, 116 | CLK_End = 91, 117 | CLK_PageDown = 92, 118 | CLK_UpArrow = 93, 119 | CLK_LeftArrow = 94, 120 | CLK_DownArrow = 95, 121 | CLK_RightArrow = 96, 122 | CLK_NonUsTilde = 97, 123 | CLK_Brightness = 98, 124 | CLK_WinLock = 99, 125 | CLK_Mute = 100, 126 | CLK_Stop = 101, 127 | CLK_ScanPreviousTrack = 102, 128 | CLK_PlayPause = 103, 129 | CLK_ScanNextTrack = 104, 130 | CLK_NumLock = 105, 131 | CLK_KeypadSlash = 106, 132 | CLK_KeypadAsterisk = 107, 133 | CLK_KeypadMinus = 108, 134 | CLK_Keypad7 = 109, 135 | CLK_Keypad8 = 110, 136 | CLK_Keypad9 = 111, 137 | CLK_KeypadPlus = 112, 138 | CLK_Keypad4 = 113, 139 | CLK_Keypad5 = 114, 140 | CLK_Keypad6 = 115, 141 | CLK_Keypad1 = 116, 142 | CLK_Keypad2 = 117, 143 | CLK_Keypad3 = 118, 144 | CLK_KeypadComma = 119, 145 | CLK_KeypadEnter = 120, 146 | CLK_Keypad0 = 121, 147 | CLK_KeypadPeriodAndDelete = 122, 148 | CLK_VolumeUp = 123, 149 | CLK_VolumeDown = 124, 150 | CLK_MR = 125, 151 | CLK_M1 = 126, 152 | CLK_M2 = 127, 153 | CLK_M3 = 128, 154 | CLK_Fn = 129 155 | }; 156 | -------------------------------------------------------------------------------- /docs/styles/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Georgia", serif; 3 | font-size: 18px; 4 | line-height: 1.4; 5 | margin: 0; 6 | padding: 0; 7 | color: #444; 8 | } 9 | 10 | body > section:first-child { 11 | width: 940px; 12 | margin: 30px auto 0 auto; 13 | } 14 | 15 | p { 16 | line-height: 1.4; 17 | } 18 | 19 | a { 20 | color: #217599; 21 | } 22 | 23 | h1 { 24 | font-size: 240%; 25 | } 26 | 27 | h1, 28 | h2, 29 | h3 { 30 | font-family: "Garamond", "Georgia", serif; 31 | color: #217599; 32 | text-decoration: underline; 33 | } 34 | 35 | aside.topic { 36 | background-color: #eee; 37 | border: 1px solid #ccc; 38 | padding: 7px 7px 0 7px; 39 | margin: 10px 0 10px 0; 40 | } 41 | 42 | aside h1 { 43 | font-size: 120%; 44 | color: #444; 45 | } 46 | 47 | aside a { 48 | text-decoration: none; 49 | border-bottom: 1px dotted #217599; 50 | } 51 | 52 | aside.note { 53 | background-color: #eee; 54 | border: 1px solid #ccc; 55 | margin: 0px -16px; 56 | padding: 8px 8px 8px 32px; 57 | } 58 | 59 | aside.note:before { 60 | content: ""; 61 | background: url("data:image/svg+xml;utf8,") no-repeat; 62 | display:block; 63 | width: 24px; 64 | height: 24px; 65 | margin: 0 0 0 -28px; 66 | position: absolute; 67 | } 68 | 69 | pre { 70 | background: #eee; 71 | padding: 8px 16px; 72 | margin: 0 -16px; 73 | overflow-x: auto; 74 | overflow-y: hidden; 75 | white-space: pre-wrap; 76 | word-wrap: break-word; 77 | } 78 | 79 | table { 80 | border: 1px solid #999999; 81 | width: 100%; 82 | } 83 | 84 | th { 85 | font-weight: 500; 86 | background-color: #bbbbbb; 87 | } 88 | 89 | td { 90 | text-align: center; 91 | } 92 | 93 | /* pygment-css: github theme */ 94 | pre .hll { background-color: #ffffcc } 95 | pre .c { color: #999988; font-style: italic } /* Comment */ 96 | pre .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 97 | pre .k { color: #000000; font-weight: bold } /* Keyword */ 98 | pre .o { color: #000000; font-weight: bold } /* Operator */ 99 | pre .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 100 | pre .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */ 101 | pre .c1 { color: #999988; font-style: italic } /* Comment.Single */ 102 | pre .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ 103 | pre .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 104 | pre .ge { color: #000000; font-style: italic } /* Generic.Emph */ 105 | pre .gr { color: #aa0000 } /* Generic.Error */ 106 | pre .gh { color: #999999 } /* Generic.Heading */ 107 | pre .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 108 | pre .go { color: #888888 } /* Generic.Output */ 109 | pre .gp { color: #555555 } /* Generic.Prompt */ 110 | pre .gs { font-weight: bold } /* Generic.Strong */ 111 | pre .gu { color: #aaaaaa } /* Generic.Subheading */ 112 | pre .gt { color: #aa0000 } /* Generic.Traceback */ 113 | pre .kc { color: #000000; font-weight: bold } /* Keyword.Constant */ 114 | pre .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */ 115 | pre .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */ 116 | pre .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */ 117 | pre .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */ 118 | pre .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 119 | pre .m { color: #009999 } /* Literal.Number */ 120 | pre .s { color: #d01040 } /* Literal.String */ 121 | pre .na { color: #008080 } /* Name.Attribute */ 122 | pre .nb { color: #0086B3 } /* Name.Builtin */ 123 | pre .nc { color: #445588; font-weight: bold } /* Name.Class */ 124 | pre .no { color: #008080 } /* Name.Constant */ 125 | pre .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */ 126 | pre .ni { color: #800080 } /* Name.Entity */ 127 | pre .ne { color: #990000; font-weight: bold } /* Name.Exception */ 128 | pre .nf { color: #990000; font-weight: bold } /* Name.Function */ 129 | pre .nl { color: #990000; font-weight: bold } /* Name.Label */ 130 | pre .nn { color: #555555 } /* Name.Namespace */ 131 | pre .nt { color: #000080 } /* Name.Tag */ 132 | pre .nv { color: #008080 } /* Name.Variable */ 133 | pre .ow { color: #000000; font-weight: bold } /* Operator.Word */ 134 | pre .w { color: #bbbbbb } /* Text.Whitespace */ 135 | pre .mf { color: #009999 } /* Literal.Number.Float */ 136 | pre .mh { color: #009999 } /* Literal.Number.Hex */ 137 | pre .mi { color: #009999 } /* Literal.Number.Integer */ 138 | pre .mo { color: #009999 } /* Literal.Number.Oct */ 139 | pre .sb { color: #d01040 } /* Literal.String.Backtick */ 140 | pre .sc { color: #d01040 } /* Literal.String.Char */ 141 | pre .sd { color: #d01040 } /* Literal.String.Doc */ 142 | pre .s2 { color: #d01040 } /* Literal.String.Double */ 143 | pre .se { color: #d01040 } /* Literal.String.Escape */ 144 | pre .sh { color: #d01040 } /* Literal.String.Heredoc */ 145 | pre .si { color: #d01040 } /* Literal.String.Interpol */ 146 | pre .sx { color: #d01040 } /* Literal.String.Other */ 147 | pre .sr { color: #009926 } /* Literal.String.Regex */ 148 | pre .s1 { color: #d01040 } /* Literal.String.Single */ 149 | pre .ss { color: #990073 } /* Literal.String.Symbol */ 150 | pre .bp { color: #999999 } /* Name.Builtin.Pseudo */ 151 | pre .vc { color: #008080 } /* Name.Variable.Class */ 152 | pre .vg { color: #008080 } /* Name.Variable.Global */ 153 | pre .vi { color: #008080 } /* Name.Variable.Instance */ 154 | pre .il { color: #009999 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /src/include/iCUESDK.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "iCUESDKGlobal.h" 4 | 5 | #ifdef __cplusplus 6 | extern "C" 7 | { 8 | #endif 9 | 10 | const unsigned int CORSAIR_STRING_SIZE_S = 64; // small string length 11 | const unsigned int CORSAIR_STRING_SIZE_M = 128; // medium string length 12 | const unsigned int CORSAIR_LAYER_PRIORITY_MAX = 255; // maximum level of layer’s priority that can be used in CorsairSetLayerPriority 13 | const unsigned int CORSAIR_DEVICE_COUNT_MAX = 64; // maximum number of devices to be discovered 14 | const unsigned int CORSAIR_DEVICE_LEDCOUNT_MAX = 512; // maximum number of LEDs controlled by device 15 | 16 | // defines a character array of length CORSAIR_DEVICE_ID_MAX to store device identifier string 17 | typedef char CorsairDeviceId[CORSAIR_STRING_SIZE_M]; 18 | 19 | // defines a type that specifies a LED identifier that is guaranteed to be unique for a specific device 20 | typedef unsigned int CorsairLedLuid; 21 | 22 | enum CorsairError // contains shared list of all errors which could happen during calling of Corsair* functions 23 | { 24 | CE_Success = 0, // if previously called function completed successfully 25 | CE_NotConnected = 1, // if iCUE is not running or was shut down or third-party control is disabled in iCUE settings (runtime error), or if developer did not call CorsairConnect after calling CorsairDisconnect or on app start (developer error) 26 | CE_NoControl = 2, // if some other client has or took over exclusive control (runtime error) 27 | CE_IncompatibleProtocol = 3, // if developer is calling the function that is not supported by the server (either because protocol has broken by server or client or because the function is new and server is too old. Check CorsairSessionDetails for details) (developer error) 28 | CE_InvalidArguments = 4, // if developer supplied invalid arguments to the function (for specifics look at function descriptions) (developer error) 29 | CE_InvalidOperation = 5, // if developer is calling the function that is not allowed due to current state (reading improper properties from device, or setting callback when it has already been set) (developer error) 30 | CE_DeviceNotFound = 6, // if invalid device id has been supplied as an argument to the function (when device id refers to disconnected device) (runtime error) 31 | CE_NotAllowed = 7 // if specific functionality (key interception) is disabled in iCUE settings (runtime error) 32 | }; 33 | 34 | enum CorsairSessionState // contains a list of all possible session states 35 | { 36 | CSS_Invalid = 0, // dummy value 37 | CSS_Closed = 1, // client not initialized or client closed connection (initial state) 38 | CSS_Connecting = 2, // client initiated connection but not connected yet 39 | CSS_Timeout = 3, // server did not respond, sdk will try again 40 | CSS_ConnectionRefused = 4, // server did not allow connection 41 | CSS_ConnectionLost = 5, // server closed connection 42 | CSS_Connected = 6 // successfully connected 43 | }; 44 | 45 | enum CorsairDeviceType // contains list of available device types 46 | { 47 | CDT_Unknown = 0x0000, // for unknown/invalid devices 48 | CDT_Keyboard = 0x0001, // for keyboards 49 | CDT_Mouse = 0x0002, // for mice 50 | CDT_Mousemat = 0x0004, // for mousemats 51 | CDT_Headset = 0x0008, // for headsets 52 | CDT_HeadsetStand = 0x0010, // for headset stands 53 | CDT_FanLedController = 0x0020, // for DIY-devices like Commander PRO 54 | CDT_LedController = 0x0040, // for DIY-devices like Lighting Node PRO 55 | CDT_MemoryModule = 0x0080, // for memory modules 56 | CDT_Cooler = 0x0100, // for coolers 57 | CDT_Motherboard = 0x0200, // for motherboards 58 | CDT_GraphicsCard = 0x0400, // for graphics cards 59 | CDT_Touchbar = 0x0800, // for touchbars 60 | CDT_GameController = 0x1000, // for game controllers 61 | CDT_All = 0xFFFFFFFF // for all devices 62 | }; 63 | 64 | enum CorsairEventId // contains list of event identifiers 65 | { 66 | CEI_Invalid = 0, // dummy value, 67 | CEI_DeviceConnectionStatusChangedEvent = 1, 68 | CEI_KeyEvent = 2 69 | }; 70 | 71 | enum CorsairMacroKeyId // contains a shared list of G, M and S keys (not all available keys!) 72 | { 73 | CMKI_Invalid = 0, 74 | CMKI_1 = 1, 75 | CMKI_2 = 2, 76 | CMKI_3 = 3, 77 | CMKI_4 = 4, 78 | CMKI_5 = 5, 79 | CMKI_6 = 6, 80 | CMKI_7 = 7, 81 | CMKI_8 = 8, 82 | CMKI_9 = 9, 83 | CMKI_10 = 10, 84 | CMKI_11 = 11, 85 | CMKI_12 = 12, 86 | CMKI_13 = 13, 87 | CMKI_14 = 14, 88 | CMKI_15 = 15, 89 | CMKI_16 = 16, 90 | CMKI_17 = 17, 91 | CMKI_18 = 18, 92 | CMKI_19 = 19, 93 | CMKI_20 = 20 94 | }; 95 | 96 | enum CorsairDevicePropertyId // contains list of properties identifiers which can be read from device 97 | { 98 | CDPI_Invalid = 0, // dummy value 99 | CDPI_PropertyArray = 1, // array of CorsairDevicePropertyId members supported by device 100 | CDPI_MicEnabled = 2, // indicates Mic state (On or Off); used for headset, headset stand 101 | CDPI_SurroundSoundEnabled = 3, // indicates Surround Sound state (On or Off); used for headset, headset stand 102 | CDPI_SidetoneEnabled = 4, // indicates Sidetone state (On or Off); used for headset (where applicable) 103 | CDPI_EqualizerPreset = 5, // the number of active equalizer preset (integer, 1 - 5); used for headset, headset stand 104 | CDPI_PhysicalLayout = 6, // keyboard physical layout (see CorsairPhysicalLayout for valid values); used for keyboard 105 | CDPI_LogicalLayout = 7, // keyboard logical layout (see CorsairLogicalLayout for valid values); used for keyboard 106 | CDPI_MacroKeyArray = 8, // array of programmable G, M or S keys on device 107 | CDPI_BatteryLevel = 9, // battery level (0 - 100); used for wireless devices 108 | CDPI_ChannelLedCount = 10, // total number of LEDs connected to the channel 109 | CDPI_ChannelDeviceCount = 11, // number of LED-devices (fans, strips, etc.) connected to the channel which is controlled by the DIY device 110 | CDPI_ChannelDeviceLedCountArray = 12, // array of integers, each element describes the number of LEDs controlled by the channel device 111 | CDPI_ChannelDeviceTypeArray = 13 // array of CorsairChannelDeviceType members, each element describes the type of the channel device 112 | }; 113 | 114 | enum CorsairDataType // contains list of available property types 115 | { 116 | CT_Boolean = 0, // for property of type Boolean 117 | CT_Int32 = 1, // for property of type Int32 or Enumeration 118 | CT_Float64 = 2, // for property of type Float64 119 | CT_String = 3, // for property of type String 120 | CT_Boolean_Array = 16, // for array of Boolean 121 | CT_Int32_Array = 17, // for array of Int32 122 | CT_Float64_Array = 18, // for array of Float64 123 | CT_String_Array = 19 // for array of String 124 | }; 125 | 126 | enum CorsairPropertyFlag // contains list of operations that can be applied to the property 127 | { 128 | CPF_None = 0x00, 129 | CPF_CanRead = 0x01, // describes readable property 130 | CPF_CanWrite = 0x02, // describes writable property 131 | CPF_Indexed = 0x04 // if flag is set, then index should be used to read/write multiple properties that share the same property identifier 132 | }; 133 | 134 | enum CorsairPhysicalLayout // contains list of available physical layouts for keyboards 135 | { 136 | CPL_Invalid = 0, 137 | CPL_US = 1, 138 | CPL_UK = 2, 139 | CPL_JP = 3, 140 | CPL_KR = 4, 141 | CPL_BR = 5 142 | }; 143 | 144 | enum CorsairLogicalLayout // contains list of available logical layouts for keyboards 145 | { 146 | CLL_Invalid = 0, 147 | CLL_US_Int = 1, 148 | CLL_NA = 2, 149 | CLL_EU = 3, 150 | CLL_UK = 4, 151 | CLL_BE = 5, 152 | CLL_BR = 6, 153 | CLL_CH = 7, 154 | CLL_CN = 8, 155 | CLL_DE = 9, 156 | CLL_ES = 10, 157 | CLL_FR = 11, 158 | CLL_IT = 12, 159 | CLL_ND = 13, 160 | CLL_RU = 14, 161 | CLL_JP = 15, 162 | CLL_KR = 16, 163 | CLL_TW = 17, 164 | CLL_MEX = 18 165 | }; 166 | 167 | enum CorsairChannelDeviceType // contains list of the LED-devices which can be connected to the DIY-device, memory module or cooler 168 | { 169 | CCDT_Invalid = 0, 170 | CCDT_HD_Fan = 1, 171 | CCDT_SP_Fan = 2, 172 | CCDT_LL_Fan = 3, 173 | CCDT_ML_Fan = 4, 174 | CCDT_QL_Fan = 5, 175 | CCDT_8LedSeriesFan = 6, 176 | CCDT_Strip = 7, 177 | CCDT_DAP = 8, 178 | CCDT_Pump = 9, 179 | CCDT_DRAM = 10, 180 | CCDT_WaterBlock = 11, 181 | CCDT_QX_Fan = 12, 182 | }; 183 | 184 | enum CorsairAccessLevel // contains list of available SDK access levels 185 | { 186 | CAL_Shared = 0, // shared mode (default) 187 | CAL_ExclusiveLightingControl = 1, // exclusive lightings, but shared events 188 | CAL_ExclusiveKeyEventsListening = 2, // exclusive key events, but shared lightings 189 | CAL_ExclusiveLightingControlAndKeyEventsListening = 3 // exclusive mode 190 | }; 191 | 192 | struct CorsairVersion // contains information about version that consists of three components 193 | { 194 | int major; 195 | int minor; 196 | int patch; 197 | }; 198 | 199 | struct CorsairSessionDetails // contains information about SDK and iCUE versions 200 | { 201 | CorsairVersion clientVersion; // version of SDK client (like {4,0,1}). Always contains valid value even if there was no iCUE found. Must comply with the semantic versioning rules. 202 | CorsairVersion serverVersion; // version of SDK server (like {4,0,1}) or empty struct ({0,0,0}) if the iCUE was not found. Must comply with the semantic versioning rules. 203 | CorsairVersion serverHostVersion; // version of iCUE (like {3,33,100}) or empty struct ({0,0,0}) if the iCUE was not found. 204 | }; 205 | 206 | struct CorsairSessionStateChanged // contains information about session state and client/server versions 207 | { 208 | CorsairSessionState state; // new session state which SDK client has been transitioned to 209 | CorsairSessionDetails details; // information about client/server versions 210 | }; 211 | 212 | struct CorsairDeviceInfo // contains information about device 213 | { 214 | CorsairDeviceType type; // enum describing device type 215 | CorsairDeviceId id; // null terminated Unicode string that contains unique device identifier 216 | char serial[CORSAIR_STRING_SIZE_M]; // null terminated Unicode string that contains device serial number. Can be empty, if serial number is not available for the device 217 | char model[CORSAIR_STRING_SIZE_M]; // null terminated Unicode string that contains device model (like “K95RGB”) 218 | int ledCount; // number of controllable LEDs on the device 219 | int channelCount; // number of channels controlled by the device 220 | }; 221 | 222 | struct CorsairLedPosition // contains led id and position of led 223 | { 224 | CorsairLedLuid id; // unique identifier of led 225 | double cx; /* for keyboards, mice, mousemats, headset stands and memory modules values are */ 226 | double cy; /* in mm, for DIY-devices, headsets and coolers values are in logical units */ 227 | }; 228 | 229 | struct CorsairDeviceFilter // contains device search filter 230 | { 231 | int deviceTypeMask; // mask that describes device types, formed as logical “or” of CorsairDeviceType enum values 232 | }; 233 | 234 | struct CorsairDeviceConnectionStatusChangedEvent // contains information about device that was connected or disconnected 235 | { 236 | CorsairDeviceId deviceId; // null terminated Unicode string that contains unique device identifier 237 | bool isConnected; // true if connected, false if disconnected 238 | }; 239 | 240 | struct CorsairKeyEvent // contains information about device where G, M or S key was pressed/released and the key itself 241 | { 242 | CorsairDeviceId deviceId; // null terminated Unicode string that contains unique device identifier 243 | CorsairMacroKeyId keyId; // G, M or S key that was pressed/released 244 | bool isPressed; // true if pressed, false if released 245 | }; 246 | 247 | struct CorsairEvent // contains information about event id and event data 248 | { 249 | CorsairEventId id; // event identifier 250 | union 251 | { 252 | const CorsairDeviceConnectionStatusChangedEvent *deviceConnectionStatusChangedEvent; // when id == CEI_DeviceConnectionStatusChangedEvent contains valid pointer to structure with information about connected or disconnected device 253 | const CorsairKeyEvent *keyEvent; // when id == CEI_KeyEvent contains valid pointer to structure with information about pressed or released G, M or S button and device where this event happened 254 | }; 255 | }; 256 | 257 | struct CorsairDataType_BooleanArray // represents an array of boolean values 258 | { 259 | bool *items; // an array of boolean values 260 | unsigned int count; // number of items array elements 261 | }; 262 | 263 | struct CorsairDataType_Int32Array // represents an array of integer values 264 | { 265 | int *items; // an array of integer values 266 | unsigned int count; // number of items array elements 267 | }; 268 | 269 | struct CorsairDataType_Float64Array // represents an array of double values 270 | { 271 | double *items; // an array of double values 272 | unsigned int count; // number of items array elements 273 | }; 274 | 275 | struct CorsairDataType_StringArray // represents an array of pointers to null terminated strings 276 | { 277 | char **items; // an array of pointers to null terminated strings 278 | unsigned int count; // number of items array elements 279 | }; 280 | 281 | union CorsairDataValue // a union of all property data types 282 | { 283 | bool boolean; // actual property value if it’s type is CPDT_Boolean 284 | int int32; // actual property value if it’s type is CPDT_Int32 285 | double float64; // actual property value if it’s type is CPDT_Float64 286 | char* string; // actual property value if it’s type is CPDT_String 287 | CorsairDataType_BooleanArray boolean_array; // actual property value if it’s type is CPDT_Boolean_Array 288 | CorsairDataType_Int32Array int32_array; // actual property value if it’s type is CPDT_Int32_Array 289 | CorsairDataType_Float64Array float64_array; // actual property value if it’s type is CPDT_Float64_Array 290 | CorsairDataType_StringArray string_array; // actual property value if it’s type is CPDT_String_Array 291 | }; 292 | 293 | struct CorsairProperty // contains information about device property type and value 294 | { 295 | CorsairDataType type; // type of property 296 | CorsairDataValue value; // property value 297 | }; 298 | 299 | struct CorsairLedColor // contains information about LED and its color 300 | { 301 | CorsairLedLuid id; // unique identifier of led 302 | unsigned char r; // red brightness [0..255] 303 | unsigned char g; // green brightness [0..255] 304 | unsigned char b; // blue brightness [0..255] 305 | unsigned char a; // alpha channel [0..255]. The opacity of the color from 0 for completely translucent to 255 for opaque 306 | }; 307 | 308 | struct CorsairKeyEventConfiguration // contains information about key event configuration 309 | { 310 | CorsairMacroKeyId keyId; // G, M or S key 311 | bool isIntercepted; // flag that defines how key event should behave. If true then iCUE will pass the event to an active exclusive SDK client and stop passing it to the rest SDK clients. If false then iCUE will resume sending it to all SDK clients 312 | }; 313 | 314 | // callback that is called by SDK when session state changed 315 | typedef void(*CorsairSessionStateChangedHandler)(void *context, const CorsairSessionStateChanged *eventData); 316 | 317 | // callback that is called by SDK when colors are set 318 | typedef void(*CorsairAsyncCallback)(void *context, CorsairError error); 319 | 320 | // callback that is called by SDK when some event happened 321 | typedef void(*CorsairEventHandler)(void *context, const CorsairEvent *event); 322 | 323 | // sets handler for session state changes, checks versions of SDK client, server and host (iCUE) to understand which of SDK functions can be used with this version of iCUE 324 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairConnect(CorsairSessionStateChangedHandler onStateChanged, void *context); 325 | 326 | // checks versions of SDK client, server and host (iCUE) to understand which of SDK functions can be used with this version of iCUE. If there is no active session or client is not connected to the server, then only client version will be filled 327 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairGetSessionDetails(CorsairSessionDetails *details); 328 | 329 | // removes handler for session state changes previously set by CorsairConnect 330 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairDisconnect(); 331 | 332 | // populates the buffer with filtered collection of devices 333 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairGetDevices(const CorsairDeviceFilter *filter, int sizeMax, CorsairDeviceInfo *devices, int *size); 334 | 335 | // gets information about device specified by deviceId 336 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairGetDeviceInfo(const CorsairDeviceId deviceId, CorsairDeviceInfo *deviceInfo); 337 | 338 | // provides a list of supported device LEDs by its id with their positions. Position could be either physical (only device-dependent) or logical (depend on device as well as iCUE settings) 339 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairGetLedPositions(const CorsairDeviceId deviceId, int sizeMax, CorsairLedPosition *ledPositions, int *size); 340 | 341 | // registers a callback that will be called by SDK when some event happened. If client is already subscribed but calls this function again SDK should use only last callback registered for sending notifications 342 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairSubscribeForEvents(CorsairEventHandler onEvent, void *context); 343 | 344 | // unregisters callback previously registered by CorsairSubscribeForEvents call 345 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairUnsubscribeFromEvents(); 346 | 347 | // this function gives possibility for a client with ExclusiveKeyEventsListening or ExclusiveLightingControlAndKeyEventsListening access level to control selected set of macro keys only and let iCUE to pass some key events to other shared clients 348 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairConfigureKeyEvent(const CorsairDeviceId deviceId, const CorsairKeyEventConfiguration *config); 349 | 350 | // gets information about device property for the device specified by deviceId 351 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairGetDevicePropertyInfo(const CorsairDeviceId deviceId, CorsairDevicePropertyId propertyId, unsigned int index, CorsairDataType *dataType, unsigned int *flags); 352 | 353 | // gets the data of device property by device identifier, property identifier and property index 354 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairReadDeviceProperty(const CorsairDeviceId deviceId, CorsairDevicePropertyId propertyId, unsigned int index, CorsairProperty *property); 355 | 356 | // sets the data of device property by device identifier, property identifier and property index. Can be called only with writable properties 357 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairWriteDeviceProperty(const CorsairDeviceId deviceId, CorsairDevicePropertyId propertyId, unsigned int index, const CorsairProperty *property); 358 | 359 | // frees memory occupied by CorsairProperty instance 360 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairFreeProperty(CorsairProperty *property); 361 | 362 | // sets specified LEDs to some colors. The color is retained until changed by successive calls. This function does not take logical layout into account. This function executes synchronously, if you are concerned about delays consider using CorsairSetLedColorsBuffer together with CorsairSetLedColorsFlushBufferAsync 363 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairSetLedColors(const CorsairDeviceId deviceId, int size, const CorsairLedColor *ledColors); 364 | 365 | // sets specified LEDs to some colors. This function sets LEDs colors in the buffer which is written to the devices via CorsairSetLedColorsFlushBufferAsync. Typical usecase is next: CorsairSetLedColorsFlushBufferAsync is called to write LEDs colors to the device and follows after one or more calls of CorsairSetLedColorsBuffer to set the LEDs buffer. This function does not take logical layout into account 366 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairSetLedColorsBuffer(const CorsairDeviceId deviceId, int size, const CorsairLedColor *ledColors); 367 | 368 | // writes to the devices LEDs colors buffer which is previously filled by the CorsairSetLedColorsBuffer function. This function executes asynchronously and returns control to the caller immediately 369 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairSetLedColorsFlushBufferAsync(CorsairAsyncCallback callback, void *context); 370 | 371 | // get current color for the list of requested LEDs of supported device. The color should represent the actual state of the hardware LED, which could be a combination of SDK and/or iCUE input 372 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairGetLedColors(const CorsairDeviceId deviceId, int size, CorsairLedColor *ledColors); 373 | 374 | // set layer priority for this shared client. By default iCUE has priority of 127 and all shared clients have priority of 128 if they don’t call this function. Layers with higher priority value are shown on top of layers with lower priority 375 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairSetLayerPriority(unsigned int priority); 376 | 377 | // retrieves LED luid for key name taking logical layout into account. So on AZERTY keyboards if user calls CorsairGetLedLuidForKeyName(‘A’, &luid) he gets luid with CLK_Q code. This luid can be used in CorsairSetLedColors or CorsairSetLedColorsBuffer function 378 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairGetLedLuidForKeyName(const CorsairDeviceId deviceId, char keyName, CorsairLedLuid *ledId); 379 | 380 | // requests control using specified access level. By default client has shared control over lighting and events so there is no need to call CorsairRequestControl() unless client requires exclusive control 381 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairRequestControl(const CorsairDeviceId deviceId, CorsairAccessLevel accessLevel); 382 | 383 | // releases previously requested control for specified device. This action resets access level to default (shared) 384 | CORSAIR_ICUE_SDK_EXPORT CorsairError CorsairReleaseControl(const CorsairDeviceId deviceId); 385 | 386 | #ifdef __cplusplus 387 | } //exten "C" 388 | #endif 389 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Overview and Reference
12 |Protocol version 18
14 | 94 |The iCUE SDK gives ability for third-party applications to control lightings on Corsair RGB devices. iCUE SDK interacts with hardware through iCUE so it should be running in order for SDK to work properly.
97 |SDK features are supported in iCUE version 4.31 or higher.
98 |To use this SDK you should have basic knowledge in C and library linking.
99 |The following folders are included:
102 |This SDK can be used on the same platforms that iCUE does:
113 |All supported devices have one or more LED groups. An LED can only belong to one LED group. Each LED within an LED group has its own unique identifier which in this document is defined as the CorsairLedLuid type. The CorsairLedLuid value consists of a group and an LED index/id, structured as follows.
126 || bits 31 .. 16 | 130 |bits 15 .. 0 | 131 |
|---|---|
| LED GROUP | 136 |LED INDEX / ID | 137 |
Examples:
145 |If a connected device only has LEDs of one color instead of all three (RGB) then when RGB color is set to such leds SDK chooses a maximum of three (RGB) values and uses it as brightness for LED.
154 |If a connected device has some LEDs that support only on/off control (as opposed to 8bit) then if supplied brightness value is >= 128 such LED will be switched on, otherwise it will be switched off.
158 |Side LEDs on CORSAIR STRAFE keyboards cannot be controlled by SDK. These LEDs remain controlled by iCUE regardless connected SDK clients.
162 |Some devices have a certain number of service LED indicators (for example, WinLock or Profile LEDs on keyboards) and depending on device model iCUE may, optionally or unconditionally, prohibit controlling these LEDs by SDK. If, however, despite the prohibition on controlling the service LEDs, SDK tries to set a color for them, the new color settings will be ignored for these service LEDs without an error.
163 |Session states are represented by CorsairSessionState enumeration. SDK client starts with CSS_Closed state. When CorsairConnect function is called, SDK sends notification that it switches to CSS_Connecting state. From CSS_Connecting it may end up with CSS_Connected (if everything is ok), CSS_Timeout (when iCUE was not found) or CSS_ConnectionRefused (if third-party control is disabled in iCUE settings). SDK performs automatic reconnects to go from failing state back to CSS_Connecting.
167 |
168 | After transitioning to CSS_Connected state SDK will notify client application about all connected devices by sending corresponding event for each device. After transitioning to CSS_Closed or CSS_ConnectionLost state SDK will notify client application that all devices have been disconnected by sending corresponding event for each device, also for all G/M/S keys which are in a pressed state at the time one of these states occurred SDK should notify client application that these keys have been released.
169 |iCUE will preserve communication channels with SDK clients when user locks screen, so when user session is restored and set of connected devices is unchanged the client can continue using SDK as if the session was never locked.
173 |When user locks screen SDK will perform transition to CSS_ConnectionLost state.
174 |When user unlocks screen SDK will perform transition to CSS_Connected state.
175 |Both iCUE and SDK are designed to work on a local computer and will not work if accessed remotely through Microsoft RDP.
179 |In order to be able to communicate with each other, iCUE and SDK client must run with identical access rights: either with regular access or "As Administrator"
183 |CorsairError CorsairSetLedColors( 190 | const CorsairDeviceId deviceId, 191 | int size, 192 | const CorsairLedColor* ledColors);193 |
Description: sets specified LEDs to some colors. The color is retained until changed by successive calls. This function does not take logical layout into account. This function executes synchronously, if you are concerned about delays consider using CorsairSetLedColorsBuffer together with CorsairSetLedColorsFlushBufferAsync.
194 |Input arguments:
195 |Returns: error code. CE_Success if successful. If there is no such ledId present in currently connected hardware (missing key in physical keyboard layout) then functions completes successfully and returns CE_Success.
201 |Possible errors:
202 |CorsairError CorsairSetLedColorsBuffer( 211 | const CorsairDeviceId deviceId, 212 | int size, 213 | const CorsairLedColor* ledColors);214 |
Description: sets specified LEDs to some colors. This function sets LEDs colors in the buffer which is written to the devices via CorsairSetLedColorsFlushBufferAsync. Typical usecase is next: CorsairSetLedColorsFlushBufferAsync is called to write LEDs colors to the device and follows after one or more calls of CorsairSetLedColorsBuffer to set the LEDs buffer. This function does not take logical layout into account.
215 |Input arguments:
216 |Returns: error code. CE_Success if successful. If there is no such ledId present in currently connected hardware (missing key in physical keyboard layout) then function completes successfully and returns CE_Success.
222 |Possible errors:
223 |typedef void(*CorsairAsyncCallback)( 232 | void *context, 233 | CorsairError error); 234 | 235 | CorsairError CorsairSetLedColorsFlushBufferAsync( 236 | CorsairAsyncCallback callback, 237 | void *context);238 |
Description: writes to the devices LEDs colors buffer which is previously filled by the CorsairSetLedColorsBuffer function. This function executes asynchronously and returns control to the caller immediately.
239 |Input arguments:
240 |Returns: error code. CE_Success if successful. If there is no such ledId present in currently connected hardware (missing key in physical keyboard layout, or trying to control mouse while it's disconnected) then function completes successfully and returns CE_Success.
250 |Possible errors:
251 |CorsairError CorsairGetDevices( 258 | const CorsairDeviceFilter *filter, 259 | int sizeMax, 260 | CorsairDeviceInfo *devices, 261 | int *size);262 |
Description: populates the buffer with filtered collection of devices
263 |Input arguments:
264 |Returns: error code. CE_Success if successful. Also devices array will contain information about devices and size - number of devices in array on return.
271 |Possible errors:
272 |CorsairError CorsairGetDeviceInfo( 280 | const CorsairDeviceId deviceId, 281 | CorsairDeviceInfo *deviceInfo);282 |
Description: gets information about device specified by deviceId
283 |Input arguments:
284 |Returns: error code. CE_Success if successful. Also deviceInfo will contain valid values read from the device on return.
289 |Possible errors:
290 |CorsairError CorsairGetDevicePropertyInfo( 298 | const CorsairDeviceId deviceId, 299 | CorsairDevicePropertyId propertyId, 300 | unsigned int index, 301 | CorsairDataType *dataType, 302 | unsigned int *flags);303 |
Description: gets information about device property for the device specified by deviceId
304 |Input arguments:
305 |Returns: error code. CE_Success if successful. Also dataType and flags will contain valid values read from device on return.
313 |Possible errors:
314 |CorsairError CorsairReadDeviceProperty( 323 | const CorsairDeviceId deviceId, 324 | CorsairDevicePropertyId propertyId, 325 | unsigned int index, 326 | CorsairProperty *property);327 |
Description: gets the data of device property by device identifier, property identifier and property index
328 |Input arguments:
329 |Returns: error code. CE_Success if successful. Also property will contain a pointer to valid property data read from device on return.
336 |Possible errors:
337 |CorsairError CorsairWriteDeviceProperty( 346 | const CorsairDeviceId deviceId, 347 | CorsairDevicePropertyId propertyId, 348 | unsigned int index, 349 | const CorsairProperty *property);350 |
Description: sets the data of device property by device identifier, property identifier and property index. Can be called only with writable properties
351 |Input arguments:
352 |Returns: error code. CE_Success if successful.
359 |Possible errors:
360 |CorsairError CorsairFreeProperty(CorsairProperty *property);369 |
Description: frees memory occupied by CorsairProperty instance
370 |Input arguments:
371 |Returns: error code. CE_Success if successful.
375 |Possible errors: - CE_InvalidArguments - if property is NULL - CE_InvalidOperation - if SDK failed to free memory for some reason
376 |CorsairError CorsairGetLedPositions( 380 | const CorsairDeviceId deviceId, 381 | int sizeMax, 382 | CorsairLedPosition *ledPositions, 383 | int *size);384 |
Description: provides a list of supported device LEDs by its id with their positions. Position could be either physical (only device-dependent) or logical (depend on device as well as iCUE settings).
385 |Input arguments:
386 |Returns: error code. CE_Success if successful. Also ledPositions array will contain information about LEDs positions and size - number of items in this array on return.
393 |Possible errors:
394 |CorsairError CorsairGetLedLuidForKeyName( 402 | const CorsairDeviceId deviceId, 403 | char keyName, 404 | CorsairLedLuid *luid);405 |
Description: retrieves LED luid for key name taking logical layout into account. So on AZERTY keyboards if user calls CorsairGetLedLuidForKeyName(deviceId, 'A', &luid) he gets luid with CLK_Q code. This luid can be used in CorsairSetLedColors or CorsairSetLedColorsBuffer function
406 |Input arguments:
407 |Returns: error code. CE_Success if successful. Also ledId will contain proper CorsairLedId on return
413 |Possible errors:
414 |CorsairError CorsairRequestControl( 422 | const CorsairDeviceId deviceId, 423 | CorsairAccessLevel accessLevel);424 |
Description: requests control using specified access level. By default client has shared control over lighting and events so there is no need to call CorsairRequestControl() unless client requires exclusive control
425 |Input arguments:
426 |Returns: error code. CE_Success if SDK received requested control
431 |Possible errors:
432 |CorsairError CorsairReleaseControl(const CorsairDeviceId deviceId);441 |
Description: releases previously requested control for specified device. This action resets access level to default (shared)
442 |Input arguments:
443 |Returns: error code. CE_Success if SDK released control
447 |Possible errors:
448 |Behavior: when this function is called iCUE should clear all colors set by previous calls to CorsairSetLedsColors*` functions if client had exclusive lighting access level and devices should show lightings that come from iCUE. Client may request exclusive control again after calling CorsairReleaseControl
453 |CorsairError CorsairGetLedColors( 457 | const CorsairDeviceId deviceId, 458 | int size, 459 | CorsairLedColor* ledColors);460 |
Description: get current color for the list of requested LEDs of supported device. The color should represent the actual state of the hardware LED, which could be a combination of SDK and/or iCUE input.
461 |Input arguments:
462 |Returns: error code. CE_Success if successful. If there is no such ledId present in currently connected hardware (missing key in physical keyboard layout, or trying to control mouse while it's disconnected) then function completes successfully and returns CE_Success. Also ledColors array will contain R, G, B and A values of colors on return
468 |Possible errors:
469 |CorsairError CorsairSetLayerPriority(unsigned int priority);477 |
Description: set layer priority for this shared client. By default iCUE has priority of 127 and all shared clients have priority of 128 if they don't call this function. Layers with higher priority value are shown on top of layers with lower priority.
478 |Input arguments:
479 |Returns: error code. CE_Success if successful. If this function is called in exclusive mode then it will return CE_Success
483 |Possible errors:
484 |typedef void(*CorsairEventHandler)( 492 | void *context, 493 | const CorsairEvent *event); 494 | 495 | CorsairError CorsairSubscribeForEvents( 496 | CorsairEventHandler onEvent, 497 | void *context);498 |
Description: registers a callback that will be called by SDK when some event happened. If client is already subscribed but calls this function again SDK should use only last callback registered for sending notifications
499 |Input arguments:
500 |Returns: error code. CE_Success if successful.
510 |Possible errors:
511 |CorsairError CorsairUnsubscribeFromEvents();519 |
Description: unregisters callback previously registered by CorsairSubscribeForEvents call
520 |Input arguments: no
521 |Returns: error code. CE_Success if successful.
522 |Possible errors:
523 |CorsairError CorsairConfigureKeyEvent( 530 | const CorsairDeviceId deviceId, 531 | const CorsairKeyEventConfiguration *config);532 |
Description: asks iCUE to send a key event from the device specified by deviceId to an exclusive SDK client only (if config->isIntercepted == true) or to all SDK clients including active exclusive client (if config->isIntercepted == false). Effective only for SDK clients with ExclusiveKeyEventsListening or ExclusiveLightingControlAndKeyEventsListening access level (see CorsairRequestControl). This function gives possibility for a client with ExclusiveKeyEventsListening or ExclusiveLightingControlAndKeyEventsListening access level to control selected set of macro keys only and let iCUE to pass some key events to other shared clients
533 |Input arguments:
534 |Returns: error code. CE_Success if configuration was successfully applied or it was not changed (but no error occurred).
539 |Possible errors:
540 |typedef void(*CorsairSessionStateChangedHandler)( 551 | void *context, 552 | const CorsairSessionStateChanged *eventData); 553 | 554 | CorsairError CorsairConnect( 555 | CorsairSessionStateChangedHandler onStateChanged, 556 | void *context);557 |
Description: sets handler for session state changes, checks versions of SDK client, server and host (iCUE) to understand which of SDK functions can be used with this version of iCUE
558 |Input arguments:
559 |CorsairSessionStateChangedHandler onStateChanged - callback that is called by SDK when session state changed. Callback parameters:
560 |561 |566 |562 |
565 |- context - contains value that was supplied by user in CorsairConnect call.
563 |- eventData - information about new session state and client/server versions.
564 |
Returns: error code. CE_Success if successful.
570 |Possible errors:
571 |CorsairError CorsairGetSessionDetails( 579 | CorsairSessionDetails* details);580 |
Description: checks versions of SDK client, server and host (iCUE) to understand which of SDK functions can be used with this version of iCUE. If there is no active session or client is not connected to the server, then only client version will be filled
581 |Input arguments:
582 |Returns: error code. CE_Success if successful.
586 |Possible errors:
587 |CE_InvalidArguments - if details is NULL
588 |CorsairError CorsairDisconnect();592 |
Description: removes handler for session state changes previously set by CorsairConnect
593 |Input arguments: no
594 |Returns: error code. CE_Success if successful.
595 |Possible errors:
596 |Behavior: before function returns session state event will be triggered with state changed to CSS_Closed
600 |enum CorsairLedGroup604 |
Description: contains a list of led groups. Led group is used as a part of led identifier
605 |Items:
606 |enum CorsairLedId_Keyboard628 |
Description: contains a list of keyboard leds that belong to CLG_Keyboard group
629 |Item samples:
630 |enum CorsairMacroKeyId638 |
Description: contains a shared list of G, M and S keys (not all available keys!)
639 |Item samples:
640 |enum CorsairDeviceType648 |
Description: contains list of available device types
649 |Items:
650 |enum CorsairChannelDeviceType671 |
Description: contains list of the LED-devices which can be connected to the DIY-device, memory module or cooler.
672 |Items:
673 |enum CorsairPhysicalLayout681 |
Description: contains list of available physical layouts for keyboards
682 |Items:
683 |enum CorsairLogicalLayout691 |
Description: contains list of available logical layouts for keyboards
692 |Items:
693 |enum CorsairSessionState701 |
Description: contains a list of all possible session states
702 |Items:
703 |enum CorsairError716 |
Description: contains shared list of all errors which could happen during calling of Corsair* functions
717 |Items:
718 |enum CorsairAccessLevel732 |
Description: contains list of available SDK access levels
733 |Items:
734 |enum CorsairEventId744 |
Description: contains list of event identifiers
745 |Items:
746 |enum CorsairDevicePropertyId754 |
Description: contains list of properties identifiers which can be read from device.
755 |Items:
756 |enum CorsairDataType776 |
Description: contains list of available property types
777 |Items:
778 |enum CorsairPropertyFlag792 |
Description: contains list of operations that can be applied to the property
793 |Items:
794 |struct CorsairLedColor804 |
Description: contains information about LED and its color
805 |Fields:
806 |struct CorsairLedPosition817 |
Description: contains led id and position of led.
818 |Fields:
819 |struct CorsairDeviceInfo827 |
Description: contains information about device
828 |Fields:
829 |struct CorsairDeviceFilter841 |
Description: contains device search filter.
842 |Fields:
843 |struct CorsairVersion850 |
Description: contains information about version that consists of three components
851 |Fields:
852 |struct CorsairSessionDetails861 |
Description: contains information about SDK and iCUE versions
862 |Fields:
863 |struct CorsairSessionStateChanged872 |
Description: contains information about session state and client/server versions
873 |Fields:
874 |struct CorsairEvent882 |
Description: contains information about event id and event data
883 |Fields:
884 |struct CorsairDeviceConnectionStatusChangedEvent902 |
Description: contains information about device that was connected or disconnected
903 |Fields:
904 |struct CorsairKeyEvent912 |
Description: contains information about device where G, M or S key was pressed/released and the key itself
913 |Fields:
914 |struct CorsairKeyEventConfiguration923 |
Description: contains information about key event configuration
924 |Fields:
925 |struct CorsairDataType_BooleanArray933 |
Description: represents an array of boolean values
934 |Fields:
935 |struct CorsairDataType_Int32Array943 |
Description: represents an array of integer values
944 |Fields:
945 |struct CorsairDataType_Float64Array953 |
Description: represents an array of double values
954 |Fields:
955 |struct CorsairDataType_StringArray963 |
Description: represents an array of pointers to null terminated strings
964 |Fields:
965 |union CorsairDataValue973 |
Description: a union of all property data types
974 |Fields:
975 |struct CorsairProperty989 |
Description: contains information about device property type and value
990 |Fields:
991 |On-Line End User License Agreement
1000 |IMPORTANT: This End-User License Agreement ("EULA") is a legal Agreement between you and Corsair Components Inc., and any of its affiliates and/or subsidiaries ("CORSAIR") with respect to the software, SDKs and source code provided by CORSAIR, any associated media, printed materials, "online" documentation and electronic documentation (collectively referred to as "Software"). By installing, copying, or otherwise using the Software, you agree to be bound by the terms of this EULA. "You" and "Your" may refer to a natural person or to a legal entity including, but not limited to, a corporation, partnership or a limited liability company. If you do not agree to the terms of this EULA, you are not authorized to install or use the Software.
1001 |CORSAIR owns certain rights in the Software. THE SOFTWARE IS A PROPRIETARY PRODUCT OF CORSAIR OR THIRD PARTIES FROM WHOM CORSAIR HAS OBTAINED LICENSING RIGHTS. THE SOFTWARE IS PROTECTED BY COPYRIGHT LAWS AND OTHER INTELLECTUAL PROPERTY LAWS. TITLE TO THIS SOFTWARE, ANY COPY OF THIS SOFTWARE, AND ANY INTELLECTUAL PROPERTY RIGHTS IN THE SOFTWARE WILL AT ALL TIMES REMAIN WITH CORSAIR AND SUCH THIRD PARTIES. Your rights are defined by this Agreement which You agree creates a legally binding and valid contract. CORSAIR retains the right to utilize its affiliated companies, authorized distributors, authorized resellers and other third parties in pursuing any of its rights and fulfilling any of its obligations under this Agreement.
1005 |CORSAIR grants to You a nonexclusive, nontransferable (except as may be required by applicable law) royalty-free license to allow You to use the Software.
1009 |(a) Transfer of Rights. You may not transfer or assign all or any portion of the Software, or any rights granted in this Agreement, to any other person.
1013 |(b) Reverse Engineering or Modifying the Software. You will not reverse engineer, decompile, translate, disassemble, or otherwise attempt to discover the source code of the Software. The prohibition against modifying or reverse engineering the Software does not apply to the extent that You are allowed to do so by applicable law including, but not limited to, the European Union Directive on the Interoperability of Software or its implementing legislation in the member countries. You may not otherwise modify, alter, adapt, or merge the Software.
1014 |(c) Third Party Supplier. You agree that CORSAIR's third party suppliers may enforce this Agreement as it relates to their Software directly against You.
1015 |(d) Export. CORSAIR shall not be required to undertake any action pursuant to this Agreement that is prevented by any impediments arising out of national or international foreign trade or customs requirements, including embargoes or any other sanctions. This Agreement is subject to all United States government laws and regulations as may be enacted, amended or modified from time to time regarding the export from the United States of CORSAIR software, services, technology, or any derivatives thereof. You will not export or re-export any CORSAIR software, services, technology, or any derivatives thereof, or permit the shipment of same. This section will survive the expiration or termination of this Agreement for any reason.
1016 |CORSAIR reserves the right to terminate this Agreement if You fail to comply with any of the terms described herein. All license rights granted will cease upon any termination of this Agreement.
1020 |CORSAIR MAKES NO WARRANTIES OF ANY KIND, AND NO WARRANTY IS GIVEN THAT THE SOFTWARE IS ERROR-FREE OR THAT ITS USE WILL BE UNINTERRUPTED OR THAT IT WILL WORK IN CONNECTION WITH ANY OTHER SOFTWARE. ALL WARRANTIES, CONDITIONS, REPRESENTATIONS, INDEMNITIES AND GUARANTEES, WHETHER EXPRESS OR IMPLIED, ARISING BY LAW, CUSTOM, PRIOR ORAL OR WRITTEN STATEMENTS (INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR PARTICULAR PURPOSE OR OF ERROR-FREE AND UNINTERRUPTED USE OR ANY WARRANTY AGAINST INFRINGEMENT) ARE HEREBY OVERRIDDEN, EXCLUDED AND DISCLAIMED, EXCEPT AS OTHERWISE EXPRESSLY STATED IN THIS LICENSE AGREEMENT.
1024 |CORSAIR's entire liability for all claims or damages arising out of or related to this Agreement, regardless of the form of action, whether in contract, equity, negligence, intended conduct, tort or otherwise, will be limited to and will not exceed, in the aggregate for all claims, actions and causes of action of every kind and nature; the amount paid to CORSAIR for the specific item that caused the damage or that is the subject matter of the cause of action. In no event will the measure of damages payable by CORSAIR include, nor will CORSAIR be liable for, any amounts for loss of income, profit or savings or indirect, incidental, consequential, exemplary, punitive or special damages of any party, including third parties, even if CORSAIR has been advised of the possibility of such damages in advance, and all such damages are expressly disclaimed. This section shall not be interpreted to exclude any liability that is prohibited from being excluded by applicable law. Except as otherwise provided by applicable law, no claim, regardless of form, arising out of or in connection with this Agreement may be brought by You unless such claim is brought either (i) within two years after the cause of action has accrued or (ii) within the shortest period of time after the cause of action has accrued that may be legally contracted for in the applicable jurisdiction if a two year limitation would be legally unenforceable.
1028 |CORSAIR offers technical support services. See www.corsair.com. Such technical support shall be provided in CORSAIR's sole discretion without any guarantee or warranty of any kind. It is your responsibility to back up of all your existing data, software and programs before receiving any technical support from CORSAIR. CORSAIR reserves the right to refuse, suspend or terminate any technical support, in its sole discretion.
1032 |This Agreement will be governed by and construed in accordance with the substantive laws of the State of California in the United States, without giving effect to any choice-of-law rules that may require the application of the laws of another jurisdiction. This Agreement will not be governed by the United Nations Convention on Contracts for the International Sale of Goods, the application of which is expressly excluded. Any disputes arising under this Agreement shall be settled exclusively in the California state courts or United States federal courts located in California. The parties hereby submit to the personal jurisdiction of such courts for the purpose of resolving any dispute under this Agreement.
1036 |If any provision of this Agreement is found to be void or unenforceable, it will not affect the validity of any other provision of this Agreement and those provisions will remain valid and enforceable according to their terms. To the extent that an unenforceable provision may be reformed to be enforceable by a court of law, such provision will be deemed to be so reformed in this Agreement.
1040 |All rights not specifically granted in this Agreement are reserved by CORSAIR.
1044 |You acknowledge that You have read this Agreement, understand it and agree to be bound by its terms and conditions. You further agree that it is the complete and exclusive statement of the agreement between us which supersedes any proposal or prior agreement, oral or written, and any other communications between us relating to the subject matter of this Agreement.
1048 |