ASUS Aura SDK v3.1 Developer's Guide
Tips & FAQs


General Tips

Suggested control interval

It is suggested to do Aura related controls around every 60ms. (Our own software controls Aura devices every 64ms, for your reference.)

COM interface

Use COM smart pointer types

If you want to access COM interfaces using C++, although you can use raw pointers directly (e.g., IAuraSdk * sdk or IAuraSdk2 * sdk), it is recommended to use "smart pointer" types (e.g., IAuraSdkPtr sdk or IAuraSdk2Ptr sdk) generated by Visual C++ instead. The smart pointer types use "resource acquisition is initialization (aka RAII)" idiom to manage COM resources for you, so you don't have to call IUnknown::Release() manually.

Please note that in some circumstance you may want to free the resource manually (e.g., before calling CoUninitialize()) even if you are using those smart pointers. In those cases, you should call the smart pointer's Release(), and should NEVER directly call IUnknown::Release() directly. For example:

int main()
{
IAuraSdkPtr sdk = nullptr;
HRESULT hr;
hr = ::CoInitialize(nullptr);
if (SUCCEEDED(hr))
{
hr = sdk.CreateInstance(/* skipped */);
// ...
// sdk->Release(); // Calling IUnknown::Release() --> WRONG!!
sdk.Release(); // Calling IAuraSdkPtr::Release().
}
// Uninitialize COM
::CoUninitialize();
return 0;
}

Call IAuraSyncDevice::Apply() in sub-thread

IAuraSyncDevice::Apply() is actually quite time-consuming since it's an I/O operation. It is suggested to put Apply() call to another thread to reduce performance impact.

Unity Plugin

Aura works in Editor mode but failed to build .exe

Please make sure the following settings are correct:

  1. Aura plugin supports PC Standalone/x86_64 only. So in File -> Build Settings -> Architecture, make sure x86_64 is selected.
  2. In Build Settings dialog, click Player Settings.... Make sure the Api Compatibility Level is .NET 4.x.

(Click here to view full-sized image)

Prevent controlling a specific key via (x,y) coordinates

Sometimes we want to control LED's of specific keys (e.g., W-A-S-D). Some might write a test program that uses methods like AsusAuraWrapper.AsusAuraService.GetKeyCodeX() and AsusAuraWrapper.AsusAuraService.GetKeyCodeY() to get the (x,y) coordinate for certain keys. Then, they use AsusAuraWrapper.AsusAuraService.UpdateDevKeyLightRGB() to control those keys:

// In test program:
coordinate_w.x = GetKeyCodeX(DEVTYPE_KEYBOARD, KeyCode.W);
coordinate_w.y = GetKeyCodeY(DEVTYPE_KEYBOARD, KeyCode.W);
coordinate_a.x = GetKeyCodeX(DEVTYPE_KEYBOARD, KeyCode.A);
coordinate_a.y = GetKeyCodeY(DEVTYPE_KEYBOARD, KeyCode.A);
coordinate_s.x = GetKeyCodeX(DEVTYPE_KEYBOARD, KeyCode.S);
coordinate_s.y = GetKeyCodeY(DEVTYPE_KEYBOARD, KeyCode.S);
coordinate_d.x = GetKeyCodeX(DEVTYPE_KEYBOARD, KeyCode.D);
coordinate_d.y = GetKeyCodeY(DEVTYPE_KEYBOARD, KeyCode.D);
...
// In game application:
UpdateDevKeyLightRGB(DEVTYPE_KEYBOARD, coordinate_w.x, coordinate_w.y, r, g, b, a);
UpdateDevKeyLightRGB(DEVTYPE_KEYBOARD, coordinate_a.x, coordinate_a.y, r, g, b, a);
UpdateDevKeyLightRGB(DEVTYPE_KEYBOARD, coordinate_s.x, coordinate_s.y, r, g, b, a);
UpdateDevKeyLightRGB(DEVTYPE_KEYBOARD, coordinate_d.x, coordinate_d.y, r, g, b, a);

However, doing so may cause unexpected lighting result since different Aura keyboards might use different "KeyCode <--> Coordinate" tables. The (x,y) of key 'W' on ROG Strix Scope might not be the same on ROG Strix Flare, not to mention those on ROG notebooks.

So the suggested method is to use AsusAuraWrapper.AsusAuraService.UpdateDevKeyLightRGBToKeyCode() directly. This method will load the proper key mapping table at run-time to prevent such issue.

// In game application:
UpdateDevKeyLightRGBToKeyCode(DEVTYPE_KEYBOARD, KeyCode.W, r, g, b, a);
UpdateDevKeyLightRGBToKeyCode(DEVTYPE_KEYBOARD, KeyCode.A, r, g, b, a);
UpdateDevKeyLightRGBToKeyCode(DEVTYPE_KEYBOARD, KeyCode.S, r, g, b, a);
UpdateDevKeyLightRGBToKeyCode(DEVTYPE_KEYBOARD, KeyCode.D, r, g, b, a);

Unreal Engine 4 Plugin

Plugin cannot be found by Unreal Engine

If you encounter such error message:

Please make sure that all plugin files have been unzipped and resides in the <project>\Plugin\AuraSDKPlugin folder.

If the AuraSDKPlugin folder does not exist, please create it manually.

Animations work in editor but does not work after packaging

The Aura plugin for UE4 does not support reading .gif or .png files from packed data. So please exclude those files from asset package and stores them as independent files.