How to trap Shift+Tab to select previous input field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to trap Shift+Tab to select previous input field
Hi Folks,
I've been searching on how to trap the shift+tab key sequence to navigate to the previous text input field, but am unable to find anything on it.
Is there a message that can be trapped? Along these same lines, is it possible to chain messages together so they might share similar actions?
Any help would be much appreciated.
Thanks,
Daryl
I've been searching on how to trap the shift+tab key sequence to navigate to the previous text input field, but am unable to find anything on it.
Is there a message that can be trapped? Along these same lines, is it possible to chain messages together so they might share similar actions?
Any help would be much appreciated.
Thanks,
Daryl
Re: How to trap Shift+Tab to select previous input field
Well, it's *supposed to work, but doesn't. I'm sure it worked in a previous LC build, but I don't have one handy right now.
Here's what works for me (assuming that your fields are numbered sequentially and start with 1 - adjust the code accordingly)
Placed in the card script so that all the fields can use it:
Here's what works for me (assuming that your fields are numbered sequentially and start with 1 - adjust the code accordingly)
Placed in the card script so that all the fields can use it:
Code: Select all
on rawKeyDown pKeyCode
local tNewTarget
-- 65056 is the keycode for the shift-tab combination
-- discovered experimentally
if pKeyCode is 65056 then
put the number of the target -1 into tNewTarget
if tNewTarget > 0 then
focus on field tNewTarget
end if
end if
pass rawKeyDown
end rawKeyDown
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: How to trap Shift+Tab to select previous input field
Daryl,
you could set the autoTab property of the fields to true in the properties inspector. Then you can tab and shift-tab through the fields in the order of their layer number.
Kind regards
Bernd
you could set the autoTab property of the fields to true in the properties inspector. Then you can tab and shift-tab through the fields in the order of their layer number.
Kind regards
Bernd
Re: How to trap Shift+Tab to select previous input field
Bernd- that's the way it's *supposed* to work, yes. But tab does the right thing, while shift-tab doesn't work correctly irrespective of the the autoTab setting.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: How to trap Shift+Tab to select previous input field
Mark,
that's funny, I tried before posting: LC version 6.0.2 on Mac OSX 10.6.8
6 fields on a card and I could tab forward and shift-tab backwards.
????
Kind regards
Bernd
that's funny, I tried before posting: LC version 6.0.2 on Mac OSX 10.6.8
6 fields on a card and I could tab forward and shift-tab backwards.
????
Kind regards
Bernd
Re: How to trap Shift+Tab to select previous input field
@Bernd- Hmmm... I tried it, too. Both times before posting. LC 6.0.2-rc1 on linux. Interesting.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: How to trap Shift+Tab to select previous input field
OK - just tried it on OSX and autoTab works the way it should.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev