1 Commits

Author SHA1 Message Date
Jed Laundry
c5e9ab752a Fix F8 hotkey not respecting Enter option
The Typer._typeEnter property was not being updated, because the LowLevelKeyboardListener was creating it's own instance, without reading settings
2025-04-06 10:05:07 +12:00
2 changed files with 5 additions and 5 deletions

View File

@@ -89,11 +89,10 @@ namespace TypeClipboard
private void Form1_Load(object sender, EventArgs e)
{
_listener = new LowLevelKeyboardListener();
_tc = new Typer();
_listener = new LowLevelKeyboardListener(_tc);
// Changing the chkHotkey.Checked property also hooks the listener
chkHotkey.Checked = Properties.Settings.Default.enableHotkey;
_tc = new Typer();
// Changing the chkEnter.Checked property also changes _tc.TypeEnter property
chkEnter.Checked = Properties.Settings.Default.enableEnter;

View File

@@ -51,11 +51,12 @@ namespace TypeClipboard
private LowLevelKeyboardProc _proc;
private IntPtr _hookID = IntPtr.Zero;
private Typer _tc = new Typer();
public Typer _tc;
public LowLevelKeyboardListener()
public LowLevelKeyboardListener(Typer tc)
{
_proc = HookCallback;
_tc = tc;
}
public void HookKeyboard()