Re: Collapse a categorized embedded View by default

In a previous article I explained how you can use the user key-events to collapse a categorized embedded View by default

Here is the code for defining the user key-events:

‘ keyboard Constant Value Description

Const KeyDown = 0 ‘ hold selected key down
Const KeyUp = 2 ‘ release selected key

‘ Abbreviation conventions

Const vKLButton = 1 ‘Left mouse button
Const vKRButton = 2 ‘Right mouse button
Const vKCancel = 3 ‘CANCEL key
Const vKMButton = 4 ‘Middle mouse button
Const vKBack = 8 ‘BACKSPACE key
Const vKTab = 9 ‘TAB key
Const vKClear = 12 ‘CLEAR key
Const vKReturn = 13 ‘ENTER key
Const vKShift = 16 ‘SHIFT key
Const vKControl = 17 ‘CTRL key
Const vKMenu = 18 ‘MENU key
Const vKPause = 19 ‘PAUSE key
Const vKCapital = 20 ‘CAPS LOCK key
Const vKEscape = 27 ‘ESC key
Const vKSpace = 32 ‘SPACEBAR key
Const vKPageUp = 33 ‘PAGE UP key
Const vKPageDown = 34 ‘PAGE DOWN key
Const vKEnd = 35 ‘END key
Const vKHome = 36 ‘HOME key
Const vKLeft = 37 ‘LEFT ARROW key
Const vKUp = 38 ‘UP ARROW key
Const vKRight = 39 ‘RIGHT ARROW key
Const vKDown = 40 ‘DOWN ARROW key
Const vKSelect = 41 ‘SELECT key
Const vKPrint = 42 ‘PRINT SCREEN key
Const vKExecute = 43 ‘EXECUTE key
Const vKSnapshot = 44 ‘SNAPSHOT key
Const vKInsert = 45 ‘INS key
Const vKDelete = 46 ‘DEL key
Const vKHelp = 47 ‘HELP key
Const vKNumlock = 144 ‘NUM LOCK key

‘KeyA Through KeyZ Are the Same as Their ASCII Equivalents: ‘A’ Through ‘Z’

Const vKA = 65 ‘A key
Const vKB = 66 ‘B key
Const vKC = 67 ‘C key
Const vKD = 68 ‘D key
Const vKE = 69 ‘E key
Const vKF = 70 ‘F key
Const vKG = 71 ‘G key
Const vKH = 72 ‘H key
Const vKI = 73 ‘I key
Const vKJ = 74 ‘J key
Const vKK = 75 ‘K key
Const vKL = 76 ‘L key
Const vKM = 77 ‘M key
Const vKN = 78 ‘N key
Const vKO = 79 ‘O key
Const vKP = 80 ‘P key
Const vKQ = 81 ‘Q key
Const vKR = 82 ‘R key
Const vKS = 83 ‘S key
Const vKT = 84 ‘T key
Const vKU = 85 ‘U key
Const vKV = 86 ‘V key
Const vKW = 87 ‘W key
Const vKX = 88 ‘X key
Const vKY = 89 ‘Y key
Const vKZ = 90 ‘Z key

‘ Key0 Through Key9 Are the Same as Their ASCII Equivalents: ‘0’ Through ‘9

Const vK0 = 48 ‘0 key
Const vK1 = 49 ‘1 key
Const vK2 = 50 ‘2 key
Const vK3 = 51 ‘3 key
Const vK4 = 52 ‘4 key
Const vK5 = 53 ‘5 key
Const vK6 = 54 ‘6 key
Const vK7 = 55 ‘7 key
Const vK8 = 56 ‘8 key
Const vK9 = 57 ‘9 key

‘ Keys on the Numeric Keypad

Const vKnP0 = 96 ‘0 key
Const vKnP1 = 97 ‘1 key
Const vKnP2 = 98 ‘2 key
Const vKnP3 = 99 ‘3 key
Const vKnP4 = 100 ‘4 key
Const vKnP5 = 101 ‘5 key
Const vKnP6 = 102 ‘6 key
Const vKnP7 = 103 ‘7 key
Const vKnP8 = 104 ‘8 key
Const vKnP9 = 105 ‘9 key
Const vKMultiply = 106 ‘MULTIPLICATION SIGN (*) key
Const vKAdd = 107 ‘PLUS SIGN (+) key
Const vKEnter = 108 ‘ENTER (keypad) key
Const vKSubtract = 109 ‘MINUS SIGN (-) key
Const vKDecimal = 110 ‘DECIMAL POINT(.) key
Const vKDivide = 111 ‘DIVISION SIGN (/) key

‘ winFunction Keys

Const vKF1 = 112 ‘F1 key
Const vKF2 = 113 ‘F2 key
Const vKF3 = 114 ‘F3 key
Const vKF4 = 115 ‘F4 key
Const vKF5 = 116 ‘F5 key
Const vKF6 = 117 ‘F6 key
Const vKF7 = 118 ‘F7 key
Const vKF8 = 119 ‘F8 key
Const vKF9 = 120 ‘F9 key
Const vKF10 = 121 ‘F10 key
Const vKF11 = 122 ‘F11 key
Const vKF12 = 123 ‘F12 key
Const vKF13 = 124 ‘F13 key
Const vKF14 = 125 ‘F14 key
Const vKF15 = 126 ‘F15 key
Const vKF16 = 127 ‘F16 key

For example:

if you want to define the user key-event to get focus on the embedded View you specify the Page Down & Space keys.

 keyboard_event vKControl , 0, KeyDown, 0
 keybod_event vKEnd , 0, KeyDown, 0
 keybd_event vKEnd , 0, KeyUp, 0
 keybd_event vKControl , 0, KeyUp, 0  
 keybd_event vKSpace, 0, KeyDown, 0
 keybd_event vKSpace, 0, KeyUp, 0  

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s