frank10 Posted June 16, 2006 Share Posted June 16, 2006 I'm trying this code: HotKeySet("^{+}", "_CurrentPane150") ;Ctrl + HotKeySet("^-", "_CurrentPane75") ;Ctrl - Func _CurrentPane150() if not WinActive('Virtual', '') Then HotKeySet("^{+}") ;ctrl + Send ('^{+}') HotKeySet("^{+}", "_CurrentPane150") Return EndIf if WinActive('Virtual', '') Then MouseClick('right', 100,100) [...] endFunc Pressing Ctrl - works well. The problem is with Ctrl + (I want to zoom in-out) Because + means also Shift, I tried "^{+}" but this doesn't work neither. So, what should i try to make a shortcut with CTRL + ? Link to comment Share on other sites More sharing options...
Nomad Posted June 16, 2006 Share Posted June 16, 2006 I'm trying this code: HotKeySet("^{+}", "_CurrentPane150") ;Ctrl + HotKeySet("^-", "_CurrentPane75") ;Ctrl - Func _CurrentPane150() if not WinActive('Virtual', '') Then HotKeySet("^{+}") ;ctrl + Send ('^{+}') HotKeySet("^{+}", "_CurrentPane150") Return EndIf if WinActive('Virtual', '') Then MouseClick('right', 100,100) [...] endFunc oÝ÷ Øú޲ȧ+k +ÌTázènW¦Ì"¶®_Á©í¶è¢h§¢ëAyÆ®±ï¦y©ìj[(J´kçjº~ªê-nëm+¡ë'ßÛp¢¹'z+az´¨Â².د+h©jÈh®×.·$Ñ/ïêº^N§vaÆ®¶s` ¤÷D¶W6WBgV÷CµãÒgV÷C²ÂgV÷Cµô7W'&VçEæSSgV÷C²´7G&° unless you mean the num pad {+}, otherwise use the {=} or you have to do a {SHIFT} + {=} to get a {+}, see? I think the num pad {+} is {NUMPADADD}, if you want that. Nomad Link to comment Share on other sites More sharing options...
frank10 Posted June 16, 2006 Author Share Posted June 16, 2006 No, I don't use the numpad. I simply want to command my '+' key. The one wich has * with shift pressed But because of the syntax of HotKeySet, I can't use it simply with +, because this means a SHIFT command (like ^ is CTRL and ! is ALT). So I thought to use the {} to tell it I want the + , not the SHIFT. But it doesn't work... What I want is pressing CTRL and + together to zoom in my view. Link to comment Share on other sites More sharing options...
Nomad Posted June 16, 2006 Share Posted June 16, 2006 No, I don't use the numpad.I simply want to command my '+' key. The one wich has * with shift pressed But because of the syntax of HotKeySet, I can't use it simply with +, because this means a SHIFT command (like ^ is CTRL and ! is ALT).So I thought to use the {} to tell it I want the + , not the SHIFT. But it doesn't work...What I want is pressing CTRL and + together to zoom in my view. hmm, my keyboard layout is different. my + is above my =. The * is above the number 8 on mine. The only other thing I can think of would be to send the hex keycode, as used through user32.dll, if you know it. Otherwise I have no idea why it's not working. I've never used a keyboard with your layout though. Link to comment Share on other sites More sharing options...
Nomad Posted June 16, 2006 Share Posted June 16, 2006 I just thought of something. Are you using a laptop? This might be the problem. I have never tried to script on a laptop or for a laptop, but the keyboard is not a standard 101/102, w/e, keyboard. The keycodes are probably going to be different on some keys since it's a compact keyboard. Do you actually have a numberpad? If not, try the {NUMPADADD} just to see, it might be coded that way for a laptop, dunno. Link to comment Share on other sites More sharing options...
frank10 Posted June 16, 2006 Author Share Posted June 16, 2006 (edited) Oh sorry about that. I didn't think of the different layout. I use an italian keyboard. It's both a laptop and normal one. Both the same layout. I searched for ascii code and made this: HotKeySet("^ {ASC 053} ", "_CurrentPane150") ;Ctrl- + And WORKS. Thank you a lot. Good idea the ascii code. Now I have a minor issue: when I press my ctrl + to zoom in, if I keep the ctrl down and press the - to zoom out this doesn't work. If I release the ctrl and repress ctrl - or ctrl + that works. Any idea? Edited June 16, 2006 by frank10 Link to comment Share on other sites More sharing options...
Nomad Posted June 16, 2006 Share Posted June 16, 2006 Oh sorry about that. I didn't think of the different layout. I use an italian keyboard.It' both a laptop and normal one. Both the same layout.I searched for ascii code and made this:HotKeySet("^ {ASC 053} ", "_CurrentPane150") ;Ctrl- +And WORKS.Thank you a lot. Good idea ascii code.Now I have a minor issue:when I press my ctrl + to zoom in, if I keep the ctrl down and press the - to zoom out this doesn't work. If I release the ctrl and repress ctrl - or ctrl + that works.Any idea? I'm glad you got it working.I don't know what you can do about that. I had an issue a while back where I wanted to interrupt the {ALT} key if it was being held down by the user, but never found a way to do it. Interrupting the {CTRL} key is going to be basically the same issue since it as also a special function key, and interrupting the keypress would be the only way to fix that problem if it is held down, from the way it sounds. So unfortunately I don't have any suggestion there, sorry. Take care,Nomad Link to comment Share on other sites More sharing options...
frank10 Posted June 16, 2006 Author Share Posted June 16, 2006 I'm speechless... Now it's not working anymore! I didn't changed anything. Only closed and reopen the script some times. I also tried in the other pc and there doesn't work. Link to comment Share on other sites More sharing options...
frank10 Posted June 16, 2006 Author Share Posted June 16, 2006 I changed approach: $dll = DllOpen("user32.dll") While 1 Sleep('200') if _IsPressed('11', $dll) and _IsPressed('BB', $dll) Then _CurrentPane150() Wend I found the value 'BB' on the Microsoft page, because in the docs of the isPressed function there wasn't the + value. This works well. Apart the same precedent problem of the ctrl pressed down that blocks other call to the function. 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