Skip to content

Commit

Permalink
macOS: Do not simulate right/middle mouse buttons in full keyboard em…
Browse files Browse the repository at this point in the history
…ulation
  • Loading branch information
FrodeSolheim committed Nov 26, 2021
1 parent 309a3df commit 74bea84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Version 3.1.x:

* macOS: Do not simulate right/middle mouse buttons in full keyboard emulation.
* Potential fix for crash if warning is issued from device helper.
* Fix mouse grab on startup on macOS.
* Support controller_[event] input mapping for matching all controllers.
* Prefer $HOME/FS-UAE if it exists, otherwise use $DOCUMENTS/FS-UAE.
Expand Down
16 changes: 9 additions & 7 deletions libfsemu/src/ml/sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,13 +1104,15 @@ int fs_ml_event_loop(void)
new_event->button.device = g_fs_ml_first_mouse_index;
new_event->button.button = event.button.button;
#ifdef MACOSX
if (new_event->button.button == 1) {
int mod = SDL_GetModState();
if (mod & KMOD_ALT) {
new_event->button.button = 2;
}
else if (mod & KMOD_CTRL) {
new_event->button.button = 3;
if (fs_emu_full_keyboard_emulation() == false) {
if (new_event->button.button == 1) {
int mod = SDL_GetModState();
if (mod & KMOD_ALT) {
new_event->button.button = 2;
}
else if (mod & KMOD_CTRL) {
new_event->button.button = 3;
}
}
}
#endif
Expand Down

0 comments on commit 74bea84

Please sign in to comment.