Switched to two hooks, so the emulator doesn't get the input from the entire host OS.

This commit is contained in:
OBattler
2024-12-31 03:59:38 +01:00
parent a11712b651
commit 8b05c58fb9
2 changed files with 42 additions and 21 deletions

View File

@@ -524,7 +524,8 @@ MediaMenu::cdromMute(int i)
void
MediaMenu::cdromMount(int i, const QString &filename)
{
QByteArray fn = filename.toUtf8().data();
QByteArray fn = filename.toUtf8().data();
int was_empty = cdrom_is_empty(i);
cdrom_exit(i);
@@ -542,9 +543,14 @@ MediaMenu::cdromMount(int i, const QString &filename)
cdrom_image_open(&(cdrom[i]), fn.data());
/* Signal media change to the emulated machine. */
if (cdrom[i].insert)
if (cdrom[i].insert) {
cdrom[i].insert(cdrom[i].priv);
/* The drive was previously empty, transition directly to UNIT ATTENTION. */
if (was_empty)
cdrom[i].insert(cdrom[i].priv);
}
if (strlen(cdrom[i].image_path) > 0)
ui_sb_update_icon_state(SB_CDROM | i, 0);
else