mirror of
https://github.com/moparisthebest/Simba
synced 2025-02-25 16:01:48 -05:00
Simba: Further clean up keybinding code.
This commit is contained in:
parent
c353870a84
commit
dfe97bf3a8
@ -576,6 +576,12 @@ begin
|
|||||||
mDebugLn('Unable to register Ctrl + Alt + S as global hotkey');
|
mDebugLn('Unable to register Ctrl + Alt + S as global hotkey');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure Unbind_Windows_Keys;
|
||||||
|
begin
|
||||||
|
if not UnRegisterHotkey(Self.Handle,0) then
|
||||||
|
mDebugLn('Unable to unregister ctrl + alt + s as global hotkey');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IFDEF LINUX_HOTKEYS}
|
{$IFDEF LINUX_HOTKEYS}
|
||||||
@ -596,6 +602,11 @@ begin
|
|||||||
if not keybinder_bind(PChar(shortcut_StopScript), @keybinder_callback, PtrUInt(0)) then
|
if not keybinder_bind(PChar(shortcut_StopScript), @keybinder_callback, PtrUInt(0)) then
|
||||||
mDebugLn('Unable to register Ctrl + Alt + S as global hotkey');
|
mDebugLn('Unable to register Ctrl + Alt + S as global hotkey');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure Unbind_Linux_Keys;
|
||||||
|
begin
|
||||||
|
keybinder_unbind(PChar(shortcut_StopScript), @keybinder_callback, PtrUInt(0));
|
||||||
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -2441,10 +2452,11 @@ begin
|
|||||||
ParamHint.Free;
|
ParamHint.Free;
|
||||||
|
|
||||||
{$ifdef MSWindows}
|
{$ifdef MSWindows}
|
||||||
if not UnRegisterHotkey(Self.Handle,0) then
|
Unbind_Windows_Keys;
|
||||||
mDebugLn('Unable to unregister ctrl + alt + s as global hotkey');
|
|
||||||
{$else}
|
{$else}
|
||||||
keybinder_unbind(PChar(shortcut_StopScript), @keybinder_callback, PtrUInt(0));
|
{$IFDEF LINUX_HOTKEYS}
|
||||||
|
Unbind_Linux_Keys;
|
||||||
|
{$ENDIF}
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user