Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
0Activity
0 of .
Results for:
No results containing your search query
P. 1
GetAsyncKeyState for Calculator

GetAsyncKeyState for Calculator

Ratings: (0)|Views: 18 |Likes:
Published by euverve
Example code about GetAsyncKeyState in VB.Net
Example code about GetAsyncKeyState in VB.Net

More info:

Published by: euverve on Apr 18, 2014
Copyright:Traditional Copyright: All rights reserved

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/18/2014

pdf

text

original

 
1C:\Documents
 
and
 
Settings\Stn02\my
 
documents\visual...\Projects\GetAsyncKeyState\GetAsyncKeyState\Form1.vb
 
Imports
 
System
 
.
 
Runtime
 
.
 
InteropServices
 
Public
 
Class
 
Form
 
1
 
<
 
DllImport
 
("
 
user
 
32
 
.
 
dll
 
")
 
>
 
_
 
Private
 
Shared
 
Function
 
GetAsyncKeyState
 
(
 
ByVal
 
vKey
 
As
 
Keys
 
)
 
As
 
Short
 
End
 
Function
 
Private
 
WithEvents
 
KeyboardKeyDetectTimer
 
As
 
New
 
Timer
 
Private
 
Sub
 
Form
 
1
 
_
 
Load
 
(
 
ByVal
 
sender
 
As
 
Object
 
,
 
ByVal
 
e
 
As
 
EventArgs
 
)
 
Handles
 
MyBase
 
.
 
Load
 
KeyboardKeyDetectTimer
 
.
 
Interval
 
=
 
75
 
KeyboardKeyDetectTimer
 
.
 
Enabled
 
=
 
True
 
KeyboardKeyDetectTimer
 
.
 
Start
 
()
 
End
 
Sub
 
Private
 
Sub
 
KeyboardKeyDetectTimer
 
_
 
Tick
 
(
 
ByVal
 
sender
 
As
 
Object
 
,
 
_
 
ByVal
 
e
 
As
 
EventArgs
 
)
 
_
 
Handles
 
KeyboardKeyDetectTimer
 
.
 
Tick
 
'
 
Numeric
 
Keypad
 
Dim
 
NumPad
 
0
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
0
 
)
 
Dim
 
NumPad
 
1
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
1
 
)
 
Dim
 
NumPad
 
2
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
2
 
)
 
Dim
 
NumPad
 
3
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
3
 
)
 
Dim
 
NumPad
 
4
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
4
 
)
 
Dim
 
NumPad
 
5
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
5
 
)
 
Dim
 
NumPad
 
6
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
6
 
)
 
Dim
 
NumPad
 
7
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
7
 
)
 
Dim
 
NumPad
 
8
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
8
 
)
 
Dim
 
NumPad
 
9
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
NumPad
 
9
 
)
 
'
 
Digits
 
Dim
 
Key
 
0
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
0
 
)
 
Dim
 
Key
 
1
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
1
 
)
 
Dim
 
Key
 
2
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
2
 
)
 
Dim
 
Key
 
3
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
3
 
)
 
Dim
 
Key
 
4
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
4
 
)
 
Dim
 
Key
 
5
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
5
 
)
 
Dim
 
Key
 
6
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
6
 
)
 
Dim
 
Key
 
7
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
7
 
)
 
Dim
 
Key
 
8
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
8
 
)
 
Dim
 
Key
 
9
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
D
 
9
 
)
 
'
 
Operations
 
Dim
 
Operator
 
_
 
Plus
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
Add
 
)
 
Dim
 
Operator
 
_
 
Minus
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
Subtract
 
)
 
Dim
 
Operator
 
_
 
Multiply
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
Multiply
 
)
 
Dim
 
Operator
 
_
 
Divide
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
Divide
 
)
 
'
 
Dot
 
and
 
Enter
 
Dim
 
KeyDot
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
OemPeriod
 
)
 
Dim
 
KeyDecimal
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
Decimal
 
)
 
Dim
 
KeyEnter
 
As
 
String
 
=
 
GetAsyncKeyState
 
(
 
Keys
 
.
 
Enter
 
)
 
'
 
For
 
numbers
 
If
 
NumPad
 
0
 
=
 
True
 
Or
 
Key
 
0
 
=
 
True
 
Then
 
MessageBox
 
.
 
Show
 
("
 
You
 
have
 
pressed
 
0
 
.")
 
ElseIf
 
NumPad
 
1
 
=
 
True
 
Or
 
Key
 
1
 
=
 
True
 
Then
 
MessageBox
 
.
 
Show
 
("
 
You
 
have
 
pressed
 
1
 
.")
 
ElseIf
 
NumPad
 
2
 
=
 
True
 
Or
 
Key
 
2
 
=
 
True
 
Then
 
MessageBox
 
.
 
Show
 
("
 
You
 
have
 
pressed
 
2
 
.")
 
ElseIf
 
NumPad
 
3
 
=
 
True
 
Or
 
Key
 
3
 
=
 
True
 
Then
 
MessageBox
 
.
 
Show
 
("
 
You
 
have
 
pressed
 
3
 
.")
 
ElseIf
 
NumPad
 
4
 
=
 
True
 
Or
 
Key
 
4
 
=
 
True
 
Then
 
MessageBox
 
.
 
Show
 
("
 
You
 
have
 
pressed
 
4
 
.")
 
ElseIf
 
NumPad
 
5
 
=
 
True
 
Or
 
Key
 
5
 
=
 
True
 
Then

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->