Menu

#1447 Pause and Ctrl-Break don't work properly with SDL

fixed_in_SVN
closed
None
1
2024-12-22
2022-04-16
No

With Bochs 2.7 configured with display_library: sdl running on CentOS 7 , if I run MS-DOS 5 QBasic, get it to run in a loop that generates a lot of output like this:

FOR i = 1 to 20000
PRINT i
NEXT i

and then run it (hit F5):

  • Ctrl-Break does nothing
  • The Pause key doesn't really work properly, if you hold it down for a very long time it starts to work intermittently, but then when the program finishes and you end up back in the editor, you need to tap the Ctrl key to be able to type again.

I see that gui/sdl.cc has these mappings in sdl_sym_to_bx_key():

case SDLK_PAUSE:                return BX_KEY_PAUSE;
...
case SDLK_BREAK:                return BX_KEY_PAUSE;

I hacked the code to generate a log message in the SDLK_BREAK case but never saw that message when hitting the Pause/Break key with or without the left Control key, so I don't know when SDL is meant to send that SDLKey.

I hacked the code some more to move that function into the bx_sdl_gui_c class so it could call get_modifier_keys(), and made it handle the SDLK_PAUSE case like this:

  if (get_modifier_keys() & BX_MOD_KEY_CTRL) {
    BX_ERROR(("FIXME ctrl-%d -> break", (int)sym));
    return BX_KEY_CTRL_BREAK;
  } else {
    BX_ERROR(("FIXME %d -> pause", (int)sym));
    return BX_KEY_PAUSE;
  }

This enabled Ctrl-Break to work, but Pause still doesn't work very well.

With the X display library on the other hand, Ctrl-Break works but Pause doesn't seem to work at all (or maybe it just takes even longer for it to start working intermittently).

Discussion

  • Volker Ruppert

    Volker Ruppert - 2024-06-02

    This seems to be a legacy SDL issue. I tried to reproduce it here, but it always generates SDLK_PAUSE, but never SDL_BREAK. So I have added your hack to the SDLK_PAUSE case. Can you confirm that it works with latest Bochs code from Github?

     
  • Volker Ruppert

    Volker Ruppert - 2024-12-22
    • status: open --> closed
    • assigned_to: Volker Ruppert
    • Group: can't_reproduce --> fixed_in_SVN
     
  • Volker Ruppert

    Volker Ruppert - 2024-12-22

    No response - closing this item.

     

Log in to post a comment.

MongoDB Logo MongoDB