Keyboard and Mouse Input in Windows: Messages, Timers, and Functions, Slides of Windows Programming

An in-depth exploration of keyboard and mouse input in the context of windows operating system. It covers various messages, timers, and functions related to keyboard and mouse handling, including wm_keydown, wm_char, getkeystate(), settimer(), and more. Understanding these concepts is crucial for developing windows applications.

Typology: Slides

2011/2012

Uploaded on 11/06/2012

parasad
parasad 🇮🇳

4.5

(56)

131 documents

1 / 61

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
L ecture #
L ecture #
16
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d

Partial preview of the text

Download Keyboard and Mouse Input in Windows: Messages, Timers, and Functions and more Slides Windows Programming in PDF only on Docsity!

LL e c te c t u ru r ee

Review of Last Lecture

getch();

Keyboard Input

Extended Keyboard Characters

Keyboard Input

Status Polling

vs

Message Driven Programming

WM_KEYDOWN
WM_KEYUP
WM_SYSKEYDOWN
WM_SYSKEYUP

Keyboard Messages

Combinations of keys with ALT

generate WM_SYSKEYDOWN

Character Messages
Keystroke Messages

Keyboard Messages

WM_KEYDOWN

WM_KEYDOWN

WM_KEYUP

WM_KEYUP

Initial State

(Shift Pressed)

(W Pressed)

(W Released)

(Shift Released)

Keystroke Messages Format WM_KEYDOWN WM_KEYUP WM_SYSKEYDOWN WM_SYSKEYUP

wParam: Virtual-key code

lParam: Additional message information

WINUSER.H identifier

wParam Keyboard key

91 92 93

VK_LWIN VK_RWIN VK_APPS

Left Windows key Right Windows key Application key

Virtual-key codes for Windows keys

lParam of WM_KEYDOWN

Bits

0 - 15 16 - 23 24

Repeat count Scan code 1, if an Extended Key 0, otherwise

Extended Keys were not part of the standard IBM keyboard. These appeared on IBM 101- and 102-keys Enhanced Keyboards later.

WM_KEYDOWN

WM_KEYDOWN

WM_KEYUP

WM_KEYUP

Initial State

(Ctrl Pressed)

(F Pressed)

(F Released)

(Ctrl Released)

GetKeyState()

SHORT GetKeyState(

int nVirtKey virtual-key code

);