Home

VKESCAPE

VK_ESCAPE is the Windows API virtual-key code that represents the Escape key on a standard keyboard. It serves as a symbolic constant used by the Windows input system to identify the Escape key across keyboard events and input handling.

Technical details

VK_ESCAPE is defined as 0x1B (decimal 27) in header files such as WinUser.h. In the Win32 message

Usage and behavior

In user interfaces, the Escape key is commonly used to cancel operations, close dialogs, or exit full-screen

Relation to broader context

VK_ESCAPE is part of the broader set of Windows virtual-key codes, which map hardware keys to logical

loop,
applications
detect
the
Escape
key
via
keyboard
messages
such
as
WM_KEYDOWN
and
WM_KEYUP,
where
the
wParam
parameter
carries
the
virtual-key
code,
including
VK_ESCAPE
when
Escape
is
pressed.
The
code
is
also
used
by
functions
that
query
or
simulate
keyboard
state,
such
as
GetAsyncKeyState
and
GetKeyState,
and
by
language
bindings
and
frameworks
that
wrap
Win32
input.
modes.
As
a
fixed
system-level
code,
VK_ESCAPE
provides
a
consistent
way
for
applications
to
respond
to
Escape
presses
regardless
of
keyboard
layout,
though
some
applications
may
override
default
behavior
for
specific
contexts.
key
identifiers.
These
codes
are
used
by
software
written
in
various
languages
(C,
C++,
C#,
Delphi,
etc.)
to
implement
consistent
keyboard
input
handling
across
the
Windows
platform.