How to trap "SHIFT+TAB" with constants?
Posted
#1
(In Topic #1280)
Regular

If I am not wrong (i tested in console debugging) the pressed SHIFT key modifies the TAB key.code in the event.
Is there a way to catch shift tab with constants? I only could with "hardcode" I know that gambas desencourages but… if there is another way, please tell me because:
Code
If key.shift and key.code = Key.tab Then What is the best approach?
This is why I endorse the "ascii" key codes. Tab keyCode is always 9 with or without Ctrl, Alt of Shift modifiers
Gambas could introduce a KEY.ASCII property … would help a lot
Posted
Guru

On my keyboard there are 2 pictures on my Tab button, one is an arrow going right (Tab) and above it an arrow going left (BackTab)
You would check for Tab or Shift+Tab (BackTab) like this..
and why need Key.Ascii when there is Asc() command?
Asc(Key.Text) does the same thing
And Print Asc(Key.Text) does not work here for Shift+Tab , only normal tab gives a value of 9, Backtab does not.
Posted
Regular

Again, something that nobody would guess.
Looking on documentation, peoples eyes look for S for SHIFT and T for TAB letters, never heard about a "Backtab".
Your help is precious. Thanks!
Posted
Guru

so a normal Tab hit acts like an ascii key press with associated \t Char but Shift+Tab is more like a function key like Del/Home/etc.
if you inspect the text with Tab/Shift+Tab press you will find the following..
Print Quote(Key.Text)
"\t" ' Tab
"" ' BackTab
So this is a case where ascii won't help as BackTab has no ascii character
1 guest and 0 members have just viewed this.


