// Update is called once per frame void Update() { if (!usingCallback) { for (int index = 6; index <= LogitechGSDK.LOGITECH_MAX_MOUSE_BUTTONS; index++) { if (LogitechGSDK.LogiGkeyIsMouseButtonPressed(index) == 1) { //These functions are not going to work if you didn't initialize the LCD SDK and calling LogiLcdUpdate every frame LogitechGSDK.LogiLcdColorSetText(0, "MOUSE", 255, 0, 0); LogitechGSDK.LogiLcdColorSetText(1, "Button : " + index, 255, 0, 0); } } for (int index = 1; index <= LogitechGSDK.LOGITECH_MAX_GKEYS; index++) { for (int mKeyIndex = 1; mKeyIndex <= LogitechGSDK.LOGITECH_MAX_M_STATES; mKeyIndex++) { if (LogitechGSDK.LogiGkeyIsKeyboardGkeyPressed(index, mKeyIndex) == 1) { //These functions are not going to work if you didn't initialize the LCD SDK and calling LogiLcdUpdate every frame LogitechGSDK.LogiLcdColorSetText(0, "KEYBOARD/HEADSET", 255, 0, 0); LogitechGSDK.LogiLcdColorSetText(1, "Button : " + index, 255, 0, 0); } } } } }
// Update is called once per frame void Update() { if (!usingCallback) { for (int index = 6; index <= LogitechGSDK.LOGITECH_MAX_MOUSE_BUTTONS; index++) { if (LogitechGSDK.LogiGkeyIsMouseButtonPressed(index) == 1) { lastKeyPress = "MOUSE DOWN Button : " + index; } } for (int index = 1; index <= LogitechGSDK.LOGITECH_MAX_GKEYS; index++) { for (int mKeyIndex = 1; mKeyIndex <= LogitechGSDK.LOGITECH_MAX_M_STATES; mKeyIndex++) { if (LogitechGSDK.LogiGkeyIsKeyboardGkeyPressed(index, mKeyIndex) == 1) { lastKeyPress = "KEYBOARD/HEADSET DOWN Button : " + index; } } } } }
private void timer1_Tick(object sender, EventArgs e) { if (!usingCallback) { for (int index = 6; index <= LogitechGSDK.LOGITECH_MAX_MOUSE_BUTTONS; index++) { if (LogitechGSDK.LogiGkeyIsMouseButtonPressed(index) == 1) { // Code to handle what happens on gkey pressed on mouse } } for (int index = 1; index <= LogitechGSDK.LOGITECH_MAX_GKEYS; index++) { for (int mKeyIndex = 1; mKeyIndex <= LogitechGSDK.LOGITECH_MAX_M_STATES; mKeyIndex++) { if (LogitechGSDK.LogiGkeyIsKeyboardGkeyPressed(index, mKeyIndex) == 1) { // Code to handle what happens on gkey pressed on keyboard/headset } } } } }