Desmond
09-28-2005, 09:52 AM
Hello,
This example demonstrates some advanced listbox techniques.
Skills Used: ListBox Object, delete multiple items, multiple selection.
azmanar
01-03-2006, 08:14 AM
Hello,
This example demonstrates some advanced listbox techniques.
Skills Used: ListBox Object, delete multiple items, multiple selection.
Hi Des,
I was testing this wonderful example when I was prompted with an error.
It says " On Key, Line 1: attempt to index global 'VK' ( a nil value ) "
This error occurred whenever I do multi-select by highlighting files in the list box by Clicking Shift Button and using the mouse.
Despite the error prompts (I clicked ok) and the REMOVE button worked. But the DELETE key don't work. As though it is not recognizing the line e_Key event in the listbox :
if e_Key == VK.Delete then
Page.ClickObject("B_Remove");
end
The same error occurred when trying to use the ENTER button to run a selected file in the listbox.
So I changed the e_Key == VK.Delete to value 46 and the e_Key == VK.Enter to value 13. (which reflects the purpose of the values).
It worked and no more error prompts.
I was wondering whether the VK ( virtual Key ) syntax is no longer valid in AM6.
Your guidance is greatly appreciated.
Desmond
01-04-2006, 09:17 AM
Hello,
In the Scripts Gallery, there should be a VirtualKeyCodes.lua file. You need to include that to get the VK functionality (it's just a variable declaration). If for whatever reason you don't have that file, here's the contents:
--[[
** Virtual Key Codes Table **
This file can be included in your AutoPlay Media Studio projects.
It is useful when handling "On Key" events, and for use in the
System.IsKeyDown action. For example:
if e_Key == VK.Spacebar then
Dialog.Message("Key Pressed","You pressed the spacebar");
end
Please note that PrintScreen, F10, and Alt buttons do not return e_Key values.
]]
--Please note that PrintScreen, F10, and Alt buttons do not return e_Key values.
VK = {
LeftMouseButton = 1,
RightMouseButton = 2,
MiddleMouseButton = 4,
Backspace = 8,
Tab = 9,
Enter = 13,
Shift = 16,
Ctrl = 17,
Pause = 19,
CapsLock = 20,
Esc = 27,
Spacebar = 32,
PageUp = 33,
PageDown = 34,
End = 35,
Home = 36,
Left = 37,
Up = 38,
Right = 39,
Down = 40,
Insert = 45,
Delete = 46,
Zero = 48,
One = 49,
Two = 50,
Three = 51,
Four = 52,
Five = 53,
Six = 54,
Seven = 55,
Eight = 56,
Nine = 57,
A = 65,
B = 66,
C = 67,
D = 68,
E = 69,
F = 70,
G = 71,
H = 72,
I = 73,
J = 74,
K = 75,
L = 76,
M = 77,
N = 78,
O = 79,
P = 80,
Q = 81,
R = 82,
S = 83,
T = 84,
U = 85,
V = 86,
W = 87,
X = 88,
Y = 89,
Z = 90,
a = 65,
b = 66,
c = 67,
d = 68,
e = 69,
f = 70,
g = 71,
h = 72,
i = 73,
j = 74,
k = 75,
l = 76,
m = 77,
n = 78,
o = 79,
p = 80,
q = 81,
r = 82,
s = 83,
t = 84,
u = 85,
v = 86,
w = 87,
x = 88,
y = 89,
z = 90,
WindowsLeft = 91,
WindowsRight = 92,
Application = 93,
Numpad0 = 96,
Numpad1 = 97,
Numpad2 = 98,
Numpad3 = 99,
Numpad4 = 100,
Numpad5 = 101,
Numpad6 = 102,
Numpad7 = 103,
Numpad8 = 104,
Numpad9 = 105,
NumpadAsterisk = 106,
NumpadPlus = 107,
NumpadDash = 109,
NumpadPeriod = 110,
NumpadForwardslash = 111,
F1 = 112,
F2 = 113,
F3 = 114,
F4 = 115,
F5 = 116,
F6 = 117,
F7 = 118,
F8 = 119,
F9 = 120,
F11 = 122,
F12 = 123,
NumLock = 144,
ScrollLock = 145,
SemiColon = 186,
Equal = 187,
Comma = 188,
Dash = 189,
Period = 190,
Forwardslash = 191,
Backquote = 192,
OpenSquare = 219,
Backslash = 220,
CloseSquare = 221,
SingleQuote = 222
};
azmanar
01-04-2006, 11:15 AM
Hello,
In the Scripts Gallery, there should be a VirtualKeyCodes.lua file. You need to include that to get the VK functionality (it's just a variable declaration). If for whatever reason you don't have that file, here's the contents:
Hi Des,
I have copied the VK table and included it in the project and intend to use for other projects as well. This table makes life easier because instead of remembering numbers, I can fire-up keys using words.
The error I faced is a blessing indeed. Otherwise, I would not have learnt more.
Thanks
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.