Rebindable aime keys
This commit is contained in:
parent
8ca5b1a051
commit
07f2c9d020
@ -246,7 +246,7 @@ static void nfc_poll(com_device_t* dev, comio_recv_head_t* req) {
|
|||||||
|
|
||||||
PNFC_CARD lpCard = p1 ? &nfcCardReaderP1 : &nfcCardReaderP2;
|
PNFC_CARD lpCard = p1 ? &nfcCardReaderP1 : &nfcCardReaderP2;
|
||||||
|
|
||||||
SHORT key = GetAsyncKeyState(p1 ? 'P' : 'L');
|
SHORT key = GetAsyncKeyState(p1 ? MiceConfig.keys.card_p1 : MiceConfig.keys.card_p2);
|
||||||
if (key < 0) {
|
if (key < 0) {
|
||||||
LPCSTR cardId = GetCardIdentifier(p1 ? 0 : 1);
|
LPCSTR cardId = GetCardIdentifier(p1 ? 0 : 1);
|
||||||
BYTE nCardBytes = TN32PopulateCard(lpCard, cardId);
|
BYTE nCardBytes = TN32PopulateCard(lpCard, cardId);
|
||||||
|
@ -91,7 +91,7 @@ static JVS_STATUS Transact(PMICE_JVS this, BYTE command) {
|
|||||||
if (MiceInputGetButtonState(&(this->m_Bindings[1]))) this->m_CoinCounts[1]++;
|
if (MiceInputGetButtonState(&(this->m_Bindings[1]))) this->m_CoinCounts[1]++;
|
||||||
|
|
||||||
for (unsigned char slot = 0; slot < coin_count; slot++) {
|
for (unsigned char slot = 0; slot < coin_count; slot++) {
|
||||||
MiceJvsWrite(this, this->m_CoinCounts[slot] >> 8);
|
MiceJvsWrite(this, (this->m_CoinCounts[slot] >> 8) & 0xff);
|
||||||
MiceJvsWrite(this, this->m_CoinCounts[slot] & 0xff);
|
MiceJvsWrite(this, this->m_CoinCounts[slot] & 0xff);
|
||||||
}
|
}
|
||||||
return JVS_STATUS_OK;
|
return JVS_STATUS_OK;
|
||||||
|
@ -893,6 +893,7 @@ void tab_system_buttons() {
|
|||||||
igNextColumn();
|
igNextColumn();
|
||||||
igSeparator();
|
igSeparator();
|
||||||
|
|
||||||
|
{
|
||||||
igTextUnformatted("System Test", NULL);
|
igTextUnformatted("System Test", NULL);
|
||||||
igNextColumn();
|
igNextColumn();
|
||||||
if (MiceConfig.keys.test == 0) {
|
if (MiceConfig.keys.test == 0) {
|
||||||
@ -917,7 +918,8 @@ void tab_system_buttons() {
|
|||||||
MiceConfig.keys.test = boundKey;
|
MiceConfig.keys.test = boundKey;
|
||||||
save_current_config(false);
|
save_current_config(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
igTextUnformatted("System Service", NULL);
|
igTextUnformatted("System Service", NULL);
|
||||||
igNextColumn();
|
igNextColumn();
|
||||||
if (MiceConfig.keys.service == 0) {
|
if (MiceConfig.keys.service == 0) {
|
||||||
@ -943,6 +945,61 @@ void tab_system_buttons() {
|
|||||||
MiceConfig.keys.service = boundKey;
|
MiceConfig.keys.service = boundKey;
|
||||||
save_current_config(false);
|
save_current_config(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
igTextUnformatted("Insert card 1P", NULL);
|
||||||
|
igNextColumn();
|
||||||
|
if (MiceConfig.keys.card_p1 == 0) {
|
||||||
|
igTextColored(DISABLED_COL, "None");
|
||||||
|
} else {
|
||||||
|
GetKeyNameTextA(MapVirtualKey(MiceConfig.keys.card_p1, MAPVK_VK_TO_VSC) << 16, keyName,
|
||||||
|
_countof(keyName));
|
||||||
|
igTextUnformatted(keyName, NULL);
|
||||||
|
}
|
||||||
|
igNextColumn();
|
||||||
|
if (igButton("Bind##Bind1P", vec0))
|
||||||
|
igOpenPopup_Str("BindSys1P", ImGuiPopupFlags_None);
|
||||||
|
if (MiceConfig.keys.card_p1) {
|
||||||
|
igSameLine(0, -1);
|
||||||
|
if (igButton("Clear##Clear1P", vec0)) {
|
||||||
|
MiceConfig.keys.card_p1 = 0;
|
||||||
|
save_current_config(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
igNextColumn();
|
||||||
|
if (igKeyBindPopup("BindSys1P", &boundKey))
|
||||||
|
if (boundKey != -1) {
|
||||||
|
MiceConfig.keys.card_p1 = boundKey;
|
||||||
|
save_current_config(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
igTextUnformatted("Insert card 2P", NULL);
|
||||||
|
igNextColumn();
|
||||||
|
if (MiceConfig.keys.card_p2 == 0) {
|
||||||
|
igTextColored(DISABLED_COL, "None");
|
||||||
|
} else {
|
||||||
|
GetKeyNameTextA(MapVirtualKey(MiceConfig.keys.card_p2, MAPVK_VK_TO_VSC) << 16, keyName,
|
||||||
|
_countof(keyName));
|
||||||
|
igTextUnformatted(keyName, NULL);
|
||||||
|
}
|
||||||
|
igNextColumn();
|
||||||
|
if (igButton("Bind##Bind2P", vec0))
|
||||||
|
igOpenPopup_Str("BindSys2P", ImGuiPopupFlags_None);
|
||||||
|
if (MiceConfig.keys.card_p2) {
|
||||||
|
igSameLine(0, -1);
|
||||||
|
if (igButton("Clear##Clear2P", vec0)) {
|
||||||
|
MiceConfig.keys.card_p2 = 0;
|
||||||
|
save_current_config(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
igNextColumn();
|
||||||
|
if (igKeyBindPopup("BindSys2P", &boundKey))
|
||||||
|
if (boundKey != -1) {
|
||||||
|
MiceConfig.keys.card_p2 = boundKey;
|
||||||
|
save_current_config(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tab_main_keybinds() {
|
void tab_main_keybinds() {
|
||||||
|
@ -84,7 +84,7 @@ void SetDataForHandle(HANDLE hObject, PVOID pData, BOOL isHeap) {
|
|||||||
};
|
};
|
||||||
MiceDAGrowAndSet(g_handleData, dwIndex, &newHandleData);
|
MiceDAGrowAndSet(g_handleData, dwIndex, &newHandleData);
|
||||||
}
|
}
|
||||||
BOOL RemoveDataForHandle(HANDLE hObject, DWORD type) {
|
BOOL RemoveDataForHandle(HANDLE hObject) {
|
||||||
if (hObject == INVALID_HANDLE_VALUE) return FALSE;
|
if (hObject == INVALID_HANDLE_VALUE) return FALSE;
|
||||||
if (!hObject & MICE_HANDLE_MASK) return FALSE;
|
if (!hObject & MICE_HANDLE_MASK) return FALSE;
|
||||||
DWORD_PTR dwIndex = (DWORD_PTR)hObject >> 2;
|
DWORD_PTR dwIndex = (DWORD_PTR)hObject >> 2;
|
||||||
|
@ -107,6 +107,8 @@ ENDSECTION(hooks)
|
|||||||
SECTION(keys, "Raw keybinding data. Edit this using the built in binding tool!")
|
SECTION(keys, "Raw keybinding data. Edit this using the built in binding tool!")
|
||||||
CFG_int(keys, test, 0, "")
|
CFG_int(keys, test, 0, "")
|
||||||
CFG_int(keys, service, 0, "")
|
CFG_int(keys, service, 0, "")
|
||||||
|
CFG_int(keys, card_p1, 13, "")
|
||||||
|
CFG_int(keys, card_p2, 32, "")
|
||||||
ENDSECTION(keys)
|
ENDSECTION(keys)
|
||||||
|
|
||||||
SECTION(devices, "Register attached hardware devices. COM4 is reserved for JVS.")
|
SECTION(devices, "Register attached hardware devices. COM4 is reserved for JVS.")
|
||||||
|
@ -32,7 +32,7 @@ DWORD GetOutermostMiceId(void) {
|
|||||||
CHAR baseName[MAX_PATH + 1];
|
CHAR baseName[MAX_PATH + 1];
|
||||||
if (GetModuleFileNameEx(hProcess, NULL, baseName, sizeof baseName)) {
|
if (GetModuleFileNameEx(hProcess, NULL, baseName, sizeof baseName)) {
|
||||||
// TODO: Better
|
// TODO: Better
|
||||||
if (stricmp(PathFindFileNameA(baseName), MICEEXE) == 0)
|
if (_stricmp(PathFindFileNameA(baseName), MICEEXE) == 0)
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
CloseHandle(hProcess);
|
CloseHandle(hProcess);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user