I am again confused about how to get a list of keycodes or how to use them.
I cannot find a listing of the Keycodes for Chr values used in Keydown.
If I look up in Keyboard the value of backspace, I get “33” which is a hex value.
At the bottom of the table is AsyncKeyDown which should not be used in Keydown or I have it wrong.
If I put Chr(33) in KeyDown(
If Key = Chr(33) Then MessageBox "backspace") I don’t have it right. The value is 08, and I don’t know where that table is.
If I look up AsyncKeyDown it shows it reads an integer, but the example uses hex.
Where is a listing of appropriate values for Keydown with appropriate examples?
Backdelete is CTRL-H or character 08 on an ascii chart
Sorry. I am on a Mac and then I hit Delete.
When l read the value in the debugger it’s 08 and the key is reported as binary, which I thought meant hex. The value in Keyboard for Delete is 75 then.
What is it?
How do I find this table for XOJO for Ascii keyCodes with Keyboard?
I also write XOJO because sometimes we have our own values.
08 in hex = 08 in decimal
backspace (the back delete right next to the += key on a us keyboard) is 08
forward delete on an extended us keyboard (near fn end etc) is a different “character”
key CODE rely on what kind of keyboard is in use though and will NOT be consistent as noted on http://documentation.xojo.com/api/hardware/keyboard.html
the CODE is more like “you pressed key 75”, which with certain layouts may be the backspace key or ANY OTHER as they keymap is defined.
So on a french keyboard it might be something different and on a german keyboard something else but its al lthe same physical key that was pressed
Yes. This part I understand from experience. Particularly the international part.
What I don’t understand is why Keyboard doesn’t show the Ascii table but instead shows a hex value which I don’t know what that is.
A hex value of 75 (delete) should be usable but I can’t figure out how.
What is that table used for?
The Ascii list is found under TextEncoding
75 would be for the forward-delete key. Presumably this is what you want:
if (Keyboard.AsyncKeyDown(51)) Then // 33 hex is 51 decimal
// do something, Backspace pressed.
I assume ASCII isn’t used in this business because many keys don’t have ASCII values (e.g., End, PageDown, …)
The values in Keyboard are completely different from the values passed to KeyDown. The values in KeyDown are from the ASCII chart.