diff --git a/App.config b/App.config
index b27d2c8..4612be2 100644
--- a/App.config
+++ b/App.config
@@ -37,6 +37,9 @@
True
+
+ False
+
\ No newline at end of file
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 6a1b9a3..aeaf42e 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -99,7 +99,7 @@
-
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index e7200bc..6324f94 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -30,6 +30,7 @@ public partial class MainWindow : Window
IsAutomaticPositioningEnabled = Properties.Settings.Default.IsAutomaticPositioningEnabled,
IsExitWithSinmaiEnabled = Properties.Settings.Default.IsExitWithSinmaiEnabled,
IsRingButtonEmulationEnabled = Properties.Settings.Default.IsRingButtonEmulationEnabled,
+ IsLargeButtonsEnabled = Properties.Settings.Default.IsLargeButtonsEnabled,
BorderColour = Properties.Settings.Default.BorderColour,
LbAppVersion = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "1.0.0.0",
};
@@ -82,8 +83,14 @@ public partial class MainWindow : Window
Logger.Info("Main window loaded, creating touch panel");
_touchPanel = new TouchPanel();
- _touchPanel.onTouch = (value) => { buttonState.PressButton(value); };
- _touchPanel.onRelease = (value) => { buttonState.ReleaseButton(value); };
+ _touchPanel.onTouch = (value) => {
+ buttonState.PressButton(value);
+ connector.SendTouchscreenState();
+ };
+ _touchPanel.onRelease = (value) => {
+ buttonState.ReleaseButton(value);
+ connector.SendTouchscreenState();
+ };
_touchPanel.onInitialReposition = () => { WindowState = WindowState.Minimized; };
_touchPanel.SetBorderMode((BorderSetting)Properties.Settings.Default.BorderSetting, dataContext.BorderColour);
_touchPanel.Show();
@@ -91,6 +98,7 @@ public partial class MainWindow : Window
_touchPanel.DataContext = dataContext;
_touchPanel.SetDebugMode(dataContext.IsDebugEnabled);
+ _touchPanel.SetLargeButtonMode(dataContext.IsLargeButtonsEnabled);
if (Properties.Settings.Default.IsAutomaticPositioningEnabled)
{
_touchPanel.DragWindowHandle.Visibility = Visibility.Hidden;
@@ -216,6 +224,16 @@ public partial class MainWindow : Window
_touchPanel?.SetDebugMode(dataContext.IsDebugEnabled);
}
+ private void largeButtons_Click(object sender, RoutedEventArgs e)
+ {
+ var dataContext = (MainWindowViewModel)DataContext;
+ var enabled = !dataContext.IsLargeButtonsEnabled;
+ dataContext.IsLargeButtonsEnabled = !enabled;
+ Properties.Settings.Default.IsLargeButtonsEnabled = dataContext.IsLargeButtonsEnabled;
+ Properties.Settings.Default.Save();
+ _touchPanel?.SetLargeButtonMode(dataContext.IsLargeButtonsEnabled);
+ }
+
private void automaticTouchPanelPositioning_Click(object sender, RoutedEventArgs e)
{
var dataContext = (MainWindowViewModel)DataContext;
diff --git a/MainWindowViewModel.cs b/MainWindowViewModel.cs
index e68a6e8..2ee044d 100644
--- a/MainWindowViewModel.cs
+++ b/MainWindowViewModel.cs
@@ -36,6 +36,10 @@ public class MainWindowViewModel : INotifyPropertyChanged
{
get; set;
}
+ public string? LbLargeButtons
+ {
+ get; set;
+ }
public string? LbExitWithSinmai
{
get; set;
@@ -222,6 +226,7 @@ public class MainWindowViewModel : INotifyPropertyChanged
private bool _isAutomaticPortConnectingEnabled;
private bool _isDebugEnabled;
+ private bool _isLargeButtonsEnabled;
private bool _isAutomaticPositioningEnabled;
private bool _isExitWithSinmaiEnabled;
private CultureInfo _selectedLanguage;
@@ -265,6 +270,16 @@ public class MainWindowViewModel : INotifyPropertyChanged
}
}
+ public bool IsLargeButtonsEnabled
+ {
+ get => _isLargeButtonsEnabled;
+ set
+ {
+ _isLargeButtonsEnabled = value;
+ OnPropertyChanged();
+ }
+ }
+
public bool IsAutomaticPositioningEnabled
{
get => _isAutomaticPositioningEnabled;
@@ -349,6 +364,7 @@ public class MainWindowViewModel : INotifyPropertyChanged
LbConnectionStateNotConnected = resourceManager.GetString("lbConnectionStateNotConnected");
LbConnectToPort = resourceManager.GetString("lbConnectToPort");
LbDebugMode = resourceManager.GetString("lbDebugMode");
+ LbLargeButtons = resourceManager.GetString("lbLargeButtons");
LbExitWithSinmai = resourceManager.GetString("lbExitWithSinmai");
LbEmulateRingButtons = resourceManager.GetString("lbEmulateRingButtons");
LbOpenLogFolder = resourceManager.GetString("LbOpenLogFolder");
diff --git a/Managers/MaiTouchComConnector.cs b/Managers/MaiTouchComConnector.cs
index 25b8181..4528364 100644
--- a/Managers/MaiTouchComConnector.cs
+++ b/Managers/MaiTouchComConnector.cs
@@ -182,7 +182,7 @@ internal class MaiTouchComConnector(MaiTouchSensorButtonStateManager buttonState
}
}
- void SendTouchscreenState()
+ public void SendTouchscreenState()
{
if (_connected && _isActiveMode)
{
diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs
index fdc093f..de94a4c 100644
--- a/Properties/Settings.Designer.cs
+++ b/Properties/Settings.Designer.cs
@@ -12,7 +12,7 @@ namespace WpfMaiTouchEmulator.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.12.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -142,5 +142,17 @@ namespace WpfMaiTouchEmulator.Properties {
this["UserSettingsUpgradeRequired"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool IsLargeButtonsEnabled {
+ get {
+ return ((bool)(this["IsLargeButtonsEnabled"]));
+ }
+ set {
+ this["IsLargeButtonsEnabled"] = value;
+ }
+ }
}
}
diff --git a/Properties/Settings.settings b/Properties/Settings.settings
index fd5c6c9..eeb5ed4 100644
--- a/Properties/Settings.settings
+++ b/Properties/Settings.settings
@@ -32,5 +32,8 @@
True
+
+ False
+
\ No newline at end of file
diff --git a/TouchPanel.xaml b/TouchPanel.xaml
index 4576beb..781854c 100644
--- a/TouchPanel.xaml
+++ b/TouchPanel.xaml
@@ -27,42 +27,42 @@
Width="1440" VerticalAlignment="Bottom">