Skip to content

Commit ec66c07

Browse files
Merge pull request #20 from daniel-widrick/OtherLanguageSupport
Other language support
2 parents 21dcc65 + a86f1f5 commit ec66c07

File tree

3 files changed

+35
-10
lines changed

3 files changed

+35
-10
lines changed

UltimateFishBot/Forms/frmMain.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,22 @@ public void ReloadHotkeys() {
138138

139139
foreach (HotKey hotKey in (HotKey[])Enum.GetValues(typeof(HotKey))) {
140140
Keys key = Keys.None;
141+
try
142+
{
143+
switch (hotKey)
144+
{
145+
case HotKey.StartStop: key = Properties.Settings.Default.StartStopHotKey; break;
146+
case HotKey.CursorCapture: key = Properties.Settings.Default.CursorCaptureHotKey; break;
147+
default: continue;
148+
}
141149

142-
switch (hotKey) {
143-
case HotKey.StartStop: key = Properties.Settings.Default.StartStopHotKey; break;
144-
case HotKey.CursorCapture: key = Properties.Settings.Default.CursorCaptureHotKey; break;
145-
default: continue;
146-
}
150+
KeyModifier modifiers = RemoveAndReturnModifiers(ref key);
151+
Win32.RegisterHotKey(this.Handle, (int)hotKey, (int)modifiers, (int)key);
147152

148-
KeyModifier modifiers = RemoveAndReturnModifiers(ref key);
149-
Win32.RegisterHotKey(this.Handle, (int)hotKey, (int)modifiers, (int)key);
153+
} catch(Exception ex)
154+
{
155+
Console.WriteLine("Unable to load Hotkey:" + key);
156+
}
150157
}
151158
}
152159

UltimateFishBot/Forms/frmSettings.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UltimateFishBot/Properties/Settings.Designer.cs

Lines changed: 20 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)