-
Notifications
You must be signed in to change notification settings - Fork 2
/
Helpers.pas
53 lines (43 loc) · 1.47 KB
/
Helpers.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{*****************************************************************}
{ }
{ Helper functions }
{ for ARSSE }
{ }
{ Copyright (c) 2011 Gregor A. Cieslak (a.k.a. Shoozza) }
{ All rights reserved }
{ }
{ NOT free to distribute or modify }
{ }
{*****************************************************************}
unit Helpers;
interface
uses
Classes;
function Ctrl: Boolean;
function Shift: Boolean;
procedure Split(const Delimiter: Char; Input: string; const Strings: TStrings);
implementation
uses
Windows;
function Ctrl: Boolean;
var
allapot: TKeyboardState;
begin
GetKeyboardState(allapot);
Result := ((allapot[vk_Control] and 128) <> 0);
end;
function Shift: Boolean;
var
State: TKeyboardState;
begin
GetKeyboardState(State);
Result := ((State[vk_Shift] and 128) <> 0);
end;
procedure Split(const Delimiter: Char; Input: string; const Strings: TStrings);
begin
Assert(Assigned(Strings));
Strings.Clear;
Strings.Delimiter := Delimiter;
Strings.DelimitedText := Input;
end;
end.