What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Cancelling/Inhibiting the default action of the TAB key?

Cancelling/Inhibiting the default action of the TAB key?
Author: Message:
asdf007
New Member
*


Posts: 1
Joined: Dec 2006
O.P. Cancelling/Inhibiting the default action of the TAB key?
Hi everyone :),

I've been working on a little script for the past few days and I've got a little problem. I'm catching the TAB (keyCode == 0x09) key within OnEvent_ChatWndEditKeyDown, and that works pretty well, but I'd also like to inhibit the default behaviour of the key (which will transfer the focus to the next control in the chat window right after OnEvent_ChatWndEditKeyDown is executed).

I'm quite a newbie when it comes to Windows API, so I've got no idea whether it's possible or not (that would be done through the InterOp object, I guess).

Another solution I was thinking about was to simulate a "shift+TAB" in the OnEvent_ChatWndEditKeyDown function, so that the actual TAB just reverses the focus back to the edit area. If that makes sense. That'd be quite tricky but oh well, anything would be fine. :P

Anyone have an idea?

edit: of course, I've tried returning true within OnEvent_ChatWndEditKeyDown. Doesn't work with TAB though. :(

This post was edited on 12-16-2006 at 08:02 PM by asdf007.
12-16-2006 07:09 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Cancelling/Inhibiting the default action of the TAB key?
Try using:

code:
function OnEvent_ChatWndEditKeyDown(ChatWnd, KeyCode, CtrlKeyDown, ShiftKeyDown){
        if(KeyCode==0x09){
                KeyCode=0; //also try null or another value
        }
}



Tested it myself :S

I think Windows determines the function of the tab key and so you cannot stop it from sending the "TAB" message. It does say on MSDN that the tab key cannot be used as a hotkey, quite possibly for this reason

BTW - You should also check the state of CtrlKeyDown and ShiftKeyDown so you don't block Ctrl+Key or Shift+Key (if you don't already ;))
<Eljay> "Problems encountered: shit blew up" :zippy:
12-17-2006 01:19 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On