[...]
I see. I didn't realize that 67 and 88 are just C and X! But with my code, I could not type C or X, only copy works. Is this because of something that has to do with the difference between KeyDown and KeyPress?
Also, what does the # sign in front of the numbers mean? (in Key = #24) How is it different from just doing key = 67?
When you say to have to the code work on other machine, did you mean PCs? I do want my code to work on PCs because people here use both platforms.
Thank you very much again!
67 is just the number, #67 is the character number 67: 'C', Capital-C to be exact.
On PC the Control-Keys are coded from #1 - Ctrl-A (Sometimes Mark all) to #26 Ctrl-Z (EOF)
On some programs Ctrl-M #13 is equal to <Enter> (but apparently not to the browser)
You could make some tests, just make a brakepoint in the first line of OnKeyPress and inspect the value of key.
Maybe when you hit c you get #99, but that's just a guess.
In KeyDown you get the Key-Value and the Shift-State, In Keypress, you get the correlated Character-Value.
in the Shift-State you get the state of all Extra-Keys (Shift, Ctrl, Alt, and maybe the Apple-Command-Key)