Check-in [c982850919]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:* If the program is already running, don't launch a second instance but activate the first; * If Shift is pressed during shutdown, no line '(closed)' is added.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c982850919d736144caa053460d28dd646248e35
User & Date: MCO 2011-05-05 08:59:17
Context
2011-05-05
09:02
* If the program is already running, don't launch a second instance but activate the first; * If Shift is pressed during shutdown, no line '(closed)' is added.
check-in: 64b934fa0b user: MCO tags: trunk
08:59
* If the program is already running, don't launch a second instance but activate the first; * If Shift is pressed during shutdown, no line '(closed)' is added. check-in: c982850919 user: MCO tags: trunk
08:59
* If the program is already running, don't launch a second instance but activate the first; * If Shift is pressed during shutdown, no line '(closed)' is added. check-in: 9584fe1b9f user: MCO tags: trunk
Changes

Added src/lib/L_KeysDown.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
unit L_KeysDown;

interface

  function isAltDown : Boolean;
  function isCtrlDown : Boolean;
  function isShiftDown : Boolean;
  function isWinkeyDown : Boolean;

implementation
uses
  Windows;

{ ------------------------------------------------------------------------------------------------ }
function isAltDown : Boolean;
var
  State: TKeyboardState;
begin
  GetKeyboardState(State) ;
  Result := ((State[vk_Menu] and 128)<>0);
end { isAltDown };

{ ------------------------------------------------------------------------------------------------ }
function isCtrlDown : Boolean;
var
  State: TKeyboardState;
begin
  GetKeyboardState(State);
  Result := ((State[VK_CONTROL] and 128)<>0);
end{ isCtrlDown };

{ ------------------------------------------------------------------------------------------------ }
function isShiftDown : Boolean;
var
  State: TKeyboardState;
begin
  GetKeyboardState(State);
  Result := ((State[vk_Shift] and 128)<>0);
end{ isShiftDown };

{ ------------------------------------------------------------------------------------------------ }
function isWinkeyDown : Boolean;
var
  State: TKeyboardState;
begin
  GetKeyboardState(State);
  Result := ((State[VK_LWIN] and 128)<>0) or ((State[VK_RWIN] and 128)<>0);
end{ isWinkeyDown };

end.