Add option to inhibit multimedia keys from host on Windows
This commit is contained in:
@@ -2141,3 +2141,6 @@ msgstr ""
|
||||
|
||||
msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer."
|
||||
msgstr ""
|
||||
|
||||
msgid "Inhibit multimedia keys on Windows"
|
||||
msgstr ""
|
||||
|
||||
@@ -226,7 +226,30 @@ emu_LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
detection; rest can't be reliably detected. */
|
||||
DWORD vkCode = lpKdhs->vkCode;
|
||||
bool up = !!(lpKdhs->flags & LLKHF_UP);
|
||||
ret = CallNextHookEx(NULL, nCode, wParam, lParam);;
|
||||
|
||||
if (inhibit_multimedia_keys
|
||||
&& (lpKdhs->vkCode == VK_MEDIA_PLAY_PAUSE
|
||||
|| lpKdhs->vkCode == VK_MEDIA_NEXT_TRACK
|
||||
|| lpKdhs->vkCode == VK_MEDIA_PREV_TRACK
|
||||
|| lpKdhs->vkCode == VK_VOLUME_DOWN
|
||||
|| lpKdhs->vkCode == VK_VOLUME_UP
|
||||
|| lpKdhs->vkCode == VK_VOLUME_MUTE
|
||||
|| lpKdhs->vkCode == VK_MEDIA_STOP
|
||||
|| lpKdhs->vkCode == VK_LAUNCH_MEDIA_SELECT
|
||||
|| lpKdhs->vkCode == VK_LAUNCH_MAIL
|
||||
|| lpKdhs->vkCode == VK_LAUNCH_APP1
|
||||
|| lpKdhs->vkCode == VK_LAUNCH_APP2
|
||||
|| lpKdhs->vkCode == VK_HELP
|
||||
|| lpKdhs->vkCode == VK_BROWSER_BACK
|
||||
|| lpKdhs->vkCode == VK_BROWSER_FORWARD
|
||||
|| lpKdhs->vkCode == VK_BROWSER_FAVORITES
|
||||
|| lpKdhs->vkCode == VK_BROWSER_HOME
|
||||
|| lpKdhs->vkCode == VK_BROWSER_REFRESH
|
||||
|| lpKdhs->vkCode == VK_BROWSER_SEARCH
|
||||
|| lpKdhs->vkCode == VK_BROWSER_STOP))
|
||||
ret = TRUE;
|
||||
else
|
||||
ret = CallNextHookEx(NULL, nCode, wParam, lParam);
|
||||
|
||||
switch (vkCode)
|
||||
{
|
||||
@@ -349,6 +372,27 @@ emu_LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
ret = TRUE;
|
||||
else if ((lpKdhs->scanCode >= 0x5b) && (lpKdhs->scanCode <= 0x5d) && (lpKdhs->flags & LLKHF_EXTENDED))
|
||||
ret = TRUE;
|
||||
else if (inhibit_multimedia_keys
|
||||
&& (lpKdhs->vkCode == VK_MEDIA_PLAY_PAUSE
|
||||
|| lpKdhs->vkCode == VK_MEDIA_NEXT_TRACK
|
||||
|| lpKdhs->vkCode == VK_MEDIA_PREV_TRACK
|
||||
|| lpKdhs->vkCode == VK_VOLUME_DOWN
|
||||
|| lpKdhs->vkCode == VK_VOLUME_UP
|
||||
|| lpKdhs->vkCode == VK_VOLUME_MUTE
|
||||
|| lpKdhs->vkCode == VK_MEDIA_STOP
|
||||
|| lpKdhs->vkCode == VK_LAUNCH_MEDIA_SELECT
|
||||
|| lpKdhs->vkCode == VK_LAUNCH_MAIL
|
||||
|| lpKdhs->vkCode == VK_LAUNCH_APP1
|
||||
|| lpKdhs->vkCode == VK_LAUNCH_APP2
|
||||
|| lpKdhs->vkCode == VK_HELP
|
||||
|| lpKdhs->vkCode == VK_BROWSER_BACK
|
||||
|| lpKdhs->vkCode == VK_BROWSER_FORWARD
|
||||
|| lpKdhs->vkCode == VK_BROWSER_FAVORITES
|
||||
|| lpKdhs->vkCode == VK_BROWSER_HOME
|
||||
|| lpKdhs->vkCode == VK_BROWSER_REFRESH
|
||||
|| lpKdhs->vkCode == VK_BROWSER_SEARCH
|
||||
|| lpKdhs->vkCode == VK_BROWSER_STOP))
|
||||
ret = TRUE;
|
||||
else
|
||||
ret = CallNextHookEx(NULL, nCode, wParam, lParam);
|
||||
|
||||
|
||||
@@ -115,14 +115,19 @@ ProgSettings::ProgSettings(QWidget *parent)
|
||||
mouseSensitivity = mouse_sensitivity;
|
||||
ui->horizontalSlider->setValue(mouseSensitivity * 100.);
|
||||
ui->openDirUsrPath->setChecked(open_dir_usr_path > 0);
|
||||
ui->checkBoxMultimediaKeys->setChecked(inhibit_multimedia_keys);
|
||||
#ifndef Q_OS_WINDOWS
|
||||
ui->checkBoxMultimediaKeys->setHidden(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
ProgSettings::accept()
|
||||
{
|
||||
strcpy(icon_set, ui->comboBox->currentData().toString().toUtf8().data());
|
||||
lang_id = ui->comboBoxLanguage->currentData().toUInt();
|
||||
open_dir_usr_path = ui->openDirUsrPath->isChecked() ? 1 : 0;
|
||||
lang_id = ui->comboBoxLanguage->currentData().toUInt();
|
||||
open_dir_usr_path = ui->openDirUsrPath->isChecked() ? 1 : 0;
|
||||
inhibit_multimedia_keys = ui->checkBoxMultimediaKeys->isChecked();
|
||||
|
||||
loadTranslators(QCoreApplication::instance());
|
||||
reloadStrings();
|
||||
|
||||
@@ -27,8 +27,122 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
<enum>QLayout::SizeConstraint::SetFixedSize</enum>
|
||||
</property>
|
||||
<item row="9" column="0">
|
||||
<widget class="QCheckBox" name="openDirUsrPath">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>When selecting media images (CD-ROM, floppy, etc.) the open dialog will start in the same directory as the 86Box configuration file. This setting will likely only make a difference on macOS.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select media images from program working directory</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QComboBox" name="comboBoxLanguage">
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>(System Default)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QPushButton" name="pushButtonLanguage">
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="13" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Icon set:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Language:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="3">
|
||||
<widget class="QSlider" name="horizontalSlider">
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>200</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="editable">
|
||||
@@ -51,13 +165,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Icon set:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
@@ -65,77 +172,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="3">
|
||||
<widget class="QSlider" name="horizontalSlider">
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>200</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QComboBox" name="comboBoxLanguage">
|
||||
<property name="maxVisibleItems">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>(System Default)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Language:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QPushButton" name="pushButtonLanguage">
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
@@ -143,39 +179,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QCheckBox" name="openDirUsrPath">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>When selecting media images (CD-ROM, floppy, etc.) the open dialog will start in the same directory as the 86Box configuration file. This setting will likely only make a difference on macOS.</p></body></html></string>
|
||||
</property>
|
||||
<item row="10" column="0">
|
||||
<widget class="QCheckBox" name="checkBoxMultimediaKeys">
|
||||
<property name="text">
|
||||
<string>Select media images from program working directory</string>
|
||||
<string>Inhibit multimedia keys on Windows</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user