|
@@ -37,7 +37,8 @@ GuiGameListMenuCtrl::GuiGameListMenuCtrl()
|
|
|
: mSelected(NO_ROW),
|
|
|
mDebugRender(false),
|
|
|
mHighlighted(NO_ROW),
|
|
|
- mCallbackOnInputs(false)
|
|
|
+ mCallbackOnInputs(false),
|
|
|
+ mConsumeKeyInputEvents(false)
|
|
|
{
|
|
|
VECTOR_SET_ASSOCIATION(mRows);
|
|
|
|
|
@@ -822,6 +823,8 @@ bool GuiGameListMenuCtrl::onInputEvent(const InputEventInfo& event)
|
|
|
if (!ActionMap::getDeviceName(event.deviceType, event.deviceInst, deviceString))
|
|
|
return false;
|
|
|
|
|
|
+ StringTableEntry deviceStringEntry = StringTable->insert(deviceString);
|
|
|
+
|
|
|
if (event.action == SI_MAKE || event.action == SI_BREAK)
|
|
|
{
|
|
|
bool isModifier = false;
|
|
@@ -847,12 +850,25 @@ bool GuiGameListMenuCtrl::onInputEvent(const InputEventInfo& event)
|
|
|
if (!ActionMap::getKeyString(event.objInst, keyString))
|
|
|
return false;
|
|
|
|
|
|
- onInputEvent_callback(deviceString, keyString, state);
|
|
|
+ onInputEvent_callback(deviceStringEntry, keyString, state);
|
|
|
+
|
|
|
+ if (mConsumeKeyInputEvents)
|
|
|
+ {
|
|
|
+ if(deviceStringEntry == StringTable->insert("keyboard"))
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
const char* actionString = ActionMap::buildActionString(&event);
|
|
|
- onInputEvent_callback(deviceString, actionString, state);
|
|
|
+ onInputEvent_callback(deviceStringEntry, actionString, state);
|
|
|
+
|
|
|
+ if (mConsumeKeyInputEvents)
|
|
|
+ {
|
|
|
+ if (deviceStringEntry == StringTable->insert("keyboard"))
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else if (event.objType == SI_AXIS || event.objType == SI_INT || event.objType == SI_FLOAT)
|
|
@@ -1401,6 +1417,10 @@ void GuiGameListMenuCtrl::initPersistFields()
|
|
|
addField("callbackOnInputs", TypeBool, Offset(mCallbackOnInputs, GuiGameListMenuCtrl),
|
|
|
"Script callback when any inputs are detected, even if they aren't the regular 4 face buttons. Useful for secondary/speciality handling of menu navigation.");
|
|
|
|
|
|
+ addField("consumeKeyInputEvents", TypeBool, Offset(mConsumeKeyInputEvents, GuiGameListMenuCtrl),
|
|
|
+ "When callbackOnInputs is active, this indicates if the input event should be consumed, or allowed 'through' to let other things respond to the event as well.");
|
|
|
+
|
|
|
+
|
|
|
Parent::initPersistFields();
|
|
|
}
|
|
|
|