UDN
Search public documentation:
GKeySDK
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
UE3 Home > Input / Output > Logitech Gaming G-key SDK for Unreal
Logitech Gaming G-key SDK for Unreal
Overview
The Logitech Gaming G-key SDK enables to get the current state of G-keys and extra mouse buttons for supported Logitech gaming mice and keyboards. It can easily be integrated in a UDK game by using DLLBind. It only works when the Logitech Gaming Software is running (8.30 or later). Find the SDK attached as a file at the bottom of this page. Please refer to the SDK’s Doc\LogitechGamingGkeySDK.pdf for details on the SDK’s functionality. For questions/comments, email cjuncker@logitech.com, or lbyrne@logitech.com.
Making the G-key SDK work in your UDK game
The following steps show how to make the Logitech SDK work with “UDKGame” that comes as part of the UDK download. Please adapt the steps to your game for things to work.
Steps
- Download UDK (http://www.unrealengine.com/udk/).
- Create the following 2 Unreal Script files, and copy them to UDK’s Development\Src\MyMod\Classes folder:
class TestDLLGameInfo extends GameInfo; defaultproperties { PlayerControllerClass=class'TestDLLPlayerController' }
class TestDLLPlayerController extends PlayerController DLLBind(LogitechGkey); dllimport final function bool LogiGkeyInitWithoutCallback(); dllimport final function bool LogiGkeyIsMouseButtonPressed(int buttonNumber); dllimport final function string LogiGkeyGetMouseButtonString(int buttonNumber); dllimport final function bool LogiGkeyIsKeyboardGkeyPressed(int gkeyNumber, int modeNumber); dllimport final function string LogiGkeyGetKeyboardGkeyString(int gkeyNumber, int modeNumber); dllimport final function LogiGkeyShutdown(); exec function LogiInit() { local bool ret; ret = LogiGkeyInitWithoutCallback(); say("LogiGkeyInitWithoutCallback return is: " $ret); } exec function LogiIsMouseButtonPressed(int buttonNumber) { local bool ret; ret = LogiGkeyIsMouseButtonPressed(buttonNumber); say("LogiGkeyIsMouseButtonPressed return is: " $ret); } exec function LogiGetMouseButtonString(int buttonNumber) { local string buttonString; buttonString = LogiGkeyGetMouseButtonString(buttonNumber); say("LogiGetMouseButtonString: " $buttonString); } exec function LogiIsKeyboardGkeyPressed(int gkeyNumber, int modeNumber) { local bool ret; ret = LogiGkeyIsKeyboardGkeyPressed(gkeyNumber, modeNumber); say("LogiGkeyIsKeyboardGkeyPressed return is: " $ret); } exec function LogiGetKeyboardGkeyString(int gkeyNumber, int modeNumber) { local string gkeyString; gkeyString = LogiGkeyGetKeyboardGkeyString(gkeyNumber, modeNumber); say("LogiGkeyGetKeyboardGkeyString: " $gkeyString); } exec function LogiShutdown() { LogiGkeyShutdown(); say("LogiGkeyShutdown done"); }
- Copy Logitech SDK’s Lib\x86\ LogitechGkey.dll to UDK’s Binaries\Win32\UserCode
- Copy Logitech SDK’s Lib\x64\ LogitechGkey.dll to UDK’s Binaries\Win64\UserCode
- Open UDK’s UDKGame\Config\ DefaultEngineUDK.ini file for editing
- Search for: ModEditPackages=MyMod
- Remove the ; at the beginning of the line
- Launch UDK’s Binaries/UnrealFrontend.exe
- Do: Script->Full recompile
Calling Logitech SDK’s functions from within the game
Launch game the following way:- Binaries\Win32\UDK.exe dm-deck?game=MyMod.TestDLLGameInfo
LogiInit
, and then hit -
LogiIsMouseButtonPressed
-
LogiGetMouseButtonString
-
LogiIsKeyboardGkeyPressed
-
LogiGetKeyboardGkeyString
-
LogiShutdown
-
LogiIsKeyboardGkeyPressed 3 2
Downloads
- LogitechGkeySDK_1.02.004.zip: LogitechGkeySDK_1.02.004