mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-02-06 15:44:23 +01:00
Fallback OSK to CTRL+WIN+O
This commit is contained in:
parent
49f86225cb
commit
147ef53a7f
|
|
@ -15,17 +15,24 @@ namespace ExternalHelpers
|
|||
|
||||
public static bool Toggle()
|
||||
{
|
||||
StartTabTip();
|
||||
try
|
||||
{
|
||||
StartTabTip();
|
||||
|
||||
var type = Type.GetTypeFromCLSID(Guid.Parse("4ce576fa-83dc-4F88-951c-9d0782b4e376"));
|
||||
if (type is null)
|
||||
var type = Type.GetTypeFromCLSID(Guid.Parse("4ce576fa-83dc-4F88-951c-9d0782b4e376"));
|
||||
if (type is null)
|
||||
return false;
|
||||
var instance = (ITipInvocation?)Activator.CreateInstance(type);
|
||||
if (instance is null)
|
||||
return false;
|
||||
instance?.Toggle(GetDesktopWindow());
|
||||
Marshal.ReleaseComObject(instance);
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
var instance = (ITipInvocation?)Activator.CreateInstance(type);
|
||||
if (instance is null)
|
||||
return false;
|
||||
instance?.Toggle(GetDesktopWindow());
|
||||
Marshal.ReleaseComObject(instance);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static void StartTabTip()
|
||||
|
|
|
|||
|
|
@ -36,14 +36,23 @@ namespace PowerControl
|
|||
CycleOptions = false,
|
||||
CurrentValue = delegate()
|
||||
{
|
||||
return Helpers.AudioManager.GetMasterVolume(5.0);
|
||||
try { return Helpers.AudioManager.GetMasterVolume(5.0); }
|
||||
catch(Exception) { return null; }
|
||||
},
|
||||
ApplyValue = delegate(object selected)
|
||||
{
|
||||
Helpers.AudioManager.SetMasterVolumeMute(false);
|
||||
Helpers.AudioManager.SetMasterVolume((int)selected);
|
||||
try
|
||||
{
|
||||
Helpers.AudioManager.SetMasterVolumeMute(false);
|
||||
Helpers.AudioManager.SetMasterVolume((int)selected);
|
||||
|
||||
return Helpers.AudioManager.GetMasterVolume(5.0);
|
||||
return Helpers.AudioManager.GetMasterVolume(5.0);
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
// In some cases MasterVolume device is missing
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
new Menu.MenuItemSeparator(),
|
||||
|
|
|
|||
|
|
@ -63,7 +63,11 @@ namespace SteamController.Profiles.Default
|
|||
break;
|
||||
|
||||
case Settings.KeyboardStyles.WindowsTouch:
|
||||
OnScreenKeyboard.Toggle();
|
||||
if (!OnScreenKeyboard.Toggle())
|
||||
{
|
||||
// Fallback to CTRL+WIN+O
|
||||
c.Keyboard.KeyPress(new VirtualKeyCode[] { VirtualKeyCode.LCONTROL, VirtualKeyCode.LWIN }, VirtualKeyCode.VK_O);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue