Skip to content

Commit

Permalink
HotkeyScheduler: Handle Wii Remote connections independently
Browse files Browse the repository at this point in the history
Allow connecting or disconnecting multiple Wii Remotes simultaneously
instead of only handling the highest index whose hotkey is pressed. This
allows using a single hotkey to toggle multiple remotes.
  • Loading branch information
Dentomologist committed Aug 27, 2024
1 parent 5af0ae2 commit 16bf5a8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Source/Core/DolphinQt/HotkeyScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,20 +277,16 @@ void HotkeyScheduler::Run()

if (Core::System::GetInstance().IsWii())
{
int wiimote_id = -1;
if (IsHotkey(HK_WIIMOTE1_CONNECT))
wiimote_id = 0;
emit ConnectWiiRemote(0);
if (IsHotkey(HK_WIIMOTE2_CONNECT))
wiimote_id = 1;
emit ConnectWiiRemote(1);
if (IsHotkey(HK_WIIMOTE3_CONNECT))
wiimote_id = 2;
emit ConnectWiiRemote(2);
if (IsHotkey(HK_WIIMOTE4_CONNECT))
wiimote_id = 3;
emit ConnectWiiRemote(3);
if (IsHotkey(HK_BALANCEBOARD_CONNECT))
wiimote_id = 4;

if (wiimote_id > -1)
emit ConnectWiiRemote(wiimote_id);
emit ConnectWiiRemote(4);

if (IsHotkey(HK_TOGGLE_SD_CARD))
Settings::Instance().SetSDCardInserted(!Settings::Instance().IsSDCardInserted());
Expand Down

0 comments on commit 16bf5a8

Please sign in to comment.