|
Detecting Keyboard strokes
|
Total Hit (15621) |
«code LangId=1»'In a module
'***************************
'* Keyboard constants
'***************************
Public Const VK_ACCEPT = &H1E
Public Const VK_ADD = &H6B
Public Const VK_APPS = &H5D
Public Const VK_ATTN = &HF6
Public Const VK_BACK = &H8
Public Const VK_BROWSER_BACK = &HA6
Public
....Read More |
Rating
|
|
|
How to detect system activity for mouse and keyboard
|
Total Hit (2607) |
«Code LangId=1»Option Explicit
'===========================================================
'TYPE
'===========================================================
Private Type POINTAPI
x As Integer
y As Integer
End Type
'===========================================================
'API
'=====
....Read More |
Rating
|
|
|
|
How to block/unblock keyboard and mouse input ?
|
Total Hit (5306) |
You can use BlockInput to block keyboard and mouse. Pass true to block and false to unblock keyboard and mouse.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Place the following code in form1
«code LangId=1»Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long)
....Read More |
Rating
|
|
|
|
SendKeys using the API
|
Total Hit (3413) |
VB provides the SendKeys command which is supposed to create key events in the focus control. However, in practice SendKeys sometimes doesn't work correctly, it is missing some keys and doesn't offer much flexibility in controlling the sequence of key strokes that gets sent. This article demonstrate
....Read More |
Rating
|
|
|
Detecting Mouse XButton Clicks
|
Total Hit (2085) |
Recently I discovered that my mouse had two strange buttons on the left-hand side (until then I'd thought that the mouse's case just wasn't very well put together). Turns out these are the 'X Buttons' and can be used for moving backwards and forwards in Explorer and IE. This sample demonstrates how
....Read More |
Rating
|
|
|
|
Moving, Clicking and Tracking the MousePointer in Code
|
Total Hit (2651) |
VB doesn't provide any way to determine where the mouse is regardless of which control its over. Neither does it allow you to move the cursor or emulate mouse clicks on objects. This tip provides a simple class which uses API functions to add this functionality.
....Read More |
Rating
|
|
|
Restrict Mouse Movement to an Area of the Desktop
|
Total Hit (1972) |
This tip shows you how to ensure a cursor remains within a certain rectangle on the screen. Note that if the user uses Alt-Tab to switch to another application, the clipping cursor is cleared.
|
Rating
|
|
|
Read the NumLock and CapsLock key states
|
Total Hit (2073) |
This sample demonstrates how to determine the state of the NumLock and CapsLock key (plus any other key on the keyboard at the same time).
|
Rating
|
|
|
Using the Joystick, Mouse and Keyboard
|
Total Hit (2099) |
So far we have learned how to move, animate and do some other stuff to sprites. We have also looked into the area of sound playback in games. This is all very nice if you want to create a game with no human interaction. Since this is most likely not the kind of game you want to make, then you need t
....Read More |
Rating
|
|