Andrew Peacock Posted April 26, 2007 Share Posted April 26, 2007 Hi all, is there anyway to capture a keypress in another application and then STOP that application responding to the keypress? I can get the keypress via _isPressed, but I can't find any way to stop it whilst leaving the cursor in the control it was in - the key in question is the down arrow, and it currently moves the focus when you press it. I want it to keep the focus EXACTLY where it is, even down to the position in the text box. Any ideas? Andy Link to comment Share on other sites More sharing options...
Toady Posted April 26, 2007 Share Posted April 26, 2007 Are you talking about disable the keys normal function after it gets detected within a program? If so do this.. HotKeySet("key","MakeKeyDoNothing") Func MakeKeyDoNothing() EndFunc www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
Andrew Peacock Posted April 26, 2007 Author Share Posted April 26, 2007 Thanks Toady, That's resolved that problem... but also stops the up/down keys working in other apps. Is there any way to stop them working only in ONE application (defined by the window title). I've messed around with ControlGetFocus to get the control ID, and then immediately putting the cursor back into that control if the window title matches, but it didn't really work- it captures the control id AFTER the cursor has already left the control in question. Admittedly, I'm trying to get the app developer to fix this - it's basically a wrapper around an IE object, and IE itself doesn't have this issue, so I think it's something to do with the wrapping functionality. The other bit I'm missing is how to get the window title from the control, so that again, it's not affecting the use of other apps. Any ideas how to do this? Regards, Andy Link to comment Share on other sites More sharing options...
Andrew Peacock Posted April 27, 2007 Author Share Posted April 27, 2007 OK, I got the answer from the developer. I've been testing their next beta, and the issue is fixed in that. For the record, I didn't find a solution via autoit. Andy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now