Hi Nigel,
I asked because in a larger project I have a complex compiler issue where hyiedefs takes over the VK_ constants and Winapi.Windows.VK_S does no longer work. For this reason, I made my own VK_ constants unit and used it at beginning of the uses clause which solves the problem:
unit VirtualKeysAlphanumeric;
// Purpose: Explicitly defines Virtual Key constants for A-Z and 0-9
// using the Ord() function.
//
// Usage: Include this unit in your 'uses' clause, preferably early
// if you suspect conflicts with other units (like third-party
// libraries or potentially modified standard units) defining
// these constants differently or incompletely.
//
// Note: This unit ONLY defines VK_A..VK_Z and VK_0..VK_9. For other
// virtual keys (VK_SHIFT, VK_ESCAPE, VK_F1, etc.), you still
// need to include and rely on the standard Winapi.Windows or
// System.UITypes units.
interface
const
// --- Letter Virtual Keys (A-Z) ---
VK_A = Ord('A'); // 65
VK_B = Ord('B'); // 66
VK_C = Ord('C'); // 67
VK_D = Ord('D'); // 68
VK_E = Ord('E'); // 69
VK_F = Ord('F'); // 70
VK_G = Ord('G'); // 71
VK_H = Ord('H'); // 72
VK_I = Ord('I'); // 73
VK_J = Ord('J'); // 74
VK_K = Ord('K'); // 75
VK_L = Ord('L'); // 76
VK_M = Ord('M'); // 77
VK_N = Ord('N'); // 78
VK_O = Ord('O'); // 79
VK_P = Ord('P'); // 80
VK_Q = Ord('Q'); // 81
VK_R = Ord('R'); // 82
VK_S = Ord('S'); // 83 <-- Includes the one originally missing
VK_T = Ord('T'); // 84
VK_U = Ord('U'); // 85
VK_V = Ord('V'); // 86
VK_W = Ord('W'); // 87
VK_X = Ord('X'); // 88
VK_Y = Ord('Y'); // 89
VK_Z = Ord('Z'); // 90
// --- Number Virtual Keys (0-9) ---
VK_0 = Ord('0'); // 48
VK_1 = Ord('1'); // 49
VK_2 = Ord('2'); // 50
VK_3 = Ord('3'); // 51
VK_4 = Ord('4'); // 52
VK_5 = Ord('5'); // 53
VK_6 = Ord('6'); // 54
VK_7 = Ord('7'); // 55
VK_8 = Ord('8'); // 56
VK_9 = Ord('9'); // 57
implementation
end.