Miranda Posted August 13, 2006 Share Posted August 13, 2006 (edited) I use a small script to repeatedly hit F8, and I want to start and stop the script by using the Button left of 1, for me its "§", on USA keyboard its "`" I think. The script works perfect with any other key, but not with that ONE key left of 1, anyone know how I can use that key? I tried search but couldn't come up with an answer so if someone could help out or point me to a post I can read I would be grateful. Edited May 17, 2012 by Miranda Link to comment Share on other sites More sharing options...
Golbez Posted August 13, 2006 Share Posted August 13, 2006 (edited) post your code so we can help u.. we need 2 see where u made your mistake Edited August 13, 2006 by Golbez Link to comment Share on other sites More sharing options...
Miranda Posted August 13, 2006 Author Share Posted August 13, 2006 aye sorry, just thoughts since its working with every other key it might be a known issue... the § is where I want to put the key left of 1 to start the macro, I keep saying left of 1 since Im using swiss keyboard, but I tried with the USA setting as well which imo is `and ~ if you use shift.. also tried ° which is the shift version of swiss keyboard, nothing worked.. but when I just type "1" there it uses the 1 key ike a charm. Dim $a=0, $b=0 HotKeySet("{PAUSE}", "EndScript") HotKeySet("§", "fSpace") While 1 Sleep(100) Send("{SCROLLLOCK off}") WEnd Func EndScript() Exit EndFunc Func fSpace() Select Case $a=0 $a=1 $b=1 While $b=1 Send("{SCROLLLOCK toggle}") Sleep(125) Send("{SCROLLLOCK toggle}") Sleep(125) Send("{F8}") WEnd Case $a=1 $a=0 $b=0 EndSelect EndFunc Link to comment Share on other sites More sharing options...
xcal Posted August 13, 2006 Share Posted August 13, 2006 For kicks, try this for your "fSpace" hotkey: HotKeySet(Chr(0xA7), "fSpace") How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Miranda Posted August 13, 2006 Author Share Posted August 13, 2006 (edited) Thanks for the suggestion, But there was no difference, I tried: HotKeySet(Chr(0xA7), "fSpace") HotKeySet("Chr(0xA7)", "fSpace") HotKeySet("ASC 21", "fSpace") HotKeySet("ASC 0167", "fSpace") HotKeySet(Chr(0167), "fSpace") All valid codes to get §, but the hotkey won't get hooked... any other suggestions? or is it simply impossible to hook § as a hotkey? Edited August 13, 2006 by Miranda Link to comment Share on other sites More sharing options...
Miranda Posted August 14, 2006 Author Share Posted August 14, 2006 (edited) hmm I take it then there is nothing I can do for now? Im also happy to read up on something I just didnt find any solution yet. thanx anyways for trying. Edited August 14, 2006 by Miranda Link to comment Share on other sites More sharing options...
Miranda Posted August 15, 2006 Author Share Posted August 15, 2006 Anyone got any insight here?I checked the support documents, and they claim any key can be bound, apart from ...the ones listed here:http://www.autoitscript.com/autoit3/docs/f...s/HotKeySet.htmBut how do I bind those special keys? since it doesn't work like a "normal" key?Thanks for any help Link to comment Share on other sites More sharing options...
Miranda Posted August 17, 2006 Author Share Posted August 17, 2006 I don't want to be annoying or anything, but could anyone tell me to shut up because no one knows the answer, or tell me how I could figure it out? Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 17, 2006 Share Posted August 17, 2006 I don't want to be annoying or anything, but could anyone tell me to shut up because no one knows the answer, or tell me how I could figure it out? Shut up, already! Ok, if you WON'T shut up... What do you get if you run this, and hit that key: While 1 $char = InputBox("Get ASCII", "Enter a single character: ", "") If $char <> "" Then $text = "Character received was: " & $char & @CRLF & _ "ASCII is: " & Asc($char) SplashTextOn("Get ASCII", $text, 300, 100, 25, 25) Else Exit EndIf WEnd Hope that helps... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Miranda Posted August 19, 2006 Author Share Posted August 19, 2006 (edited) I WON'T shut up just yet and thanx alot for your help I get: Character recived was: § ASCII is: 167 I already tried with this: HotKeySet("ASC 0167", "fSpace") and when I got only 167 I also tried without the "0" HotKeySet("ASC 167", "fSpace") was a no go *sadface* Edited August 19, 2006 by Miranda Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 19, 2006 Share Posted August 19, 2006 I WON'T shut up just yet and thanx alot for your help I get: Character recived was: § ASCII is: 167 I already tried with this: HotKeySet("ASC 0167", "fSpace") and when I got only 167 I also tried without the "0" HotKeySet("ASC 167", "fSpace") was a no go *sadface* I don't think that's formatted correctly, try: HotKeySet("{ASC 167}", "fSpace") Per the help file on HotKeySet(), the format is the same as Send(), which says: To send the ASCII value A (same as pressing ALT+065 on the numeric keypad) Send("{ASC 065}") (When using 2 digit ASCII codes you must use a leading 0, otherwise an obsolete 437 code page is used). To send UNICODE characters enter the character code (decimal or hex), for example this sends a Chinese character Send("{ASC 2709}") or Send("{ASC 0xA95}") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Miranda Posted August 19, 2006 Author Share Posted August 19, 2006 Was a no-go I've also decided to try: HotKeySet("a", "fSpace") HotKeySet("ASC 65", "fSpace") HotKeySet("ASC 065", "fSpace") HotKeySet("{ASC 65}", "fSpace") HotKeySet("{ASC 065}", "fSpace") only the first one works, so I wasn't able to hook the hotkey to a with the ASC thing... Link to comment Share on other sites More sharing options...
dandymcgee Posted August 20, 2006 Share Posted August 20, 2006 Hey, for the first time in my life I'm doing something helpful... Anyways here's the code: HotKeySet("{PAUSE}", "EndScript") $Key = Chr(0167) HotKeySet($Key, "fSpace") While 1 Sleep(100) WEnd Func EndScript() Exit EndFunc Func fSpace() MsgBox(0, "title", "yeah") EndFunc I have U.S. keyboard, so I couldn't test the §, but I did use it with ~ and it worked fine. Hope this works out for you. Dan - Dan [Website] Link to comment Share on other sites More sharing options...
Miranda Posted August 20, 2006 Author Share Posted August 20, 2006 (edited) Works like a charm, thanks a ton! Miranda Edited August 20, 2006 by Miranda Link to comment Share on other sites More sharing options...
Miranda Posted May 17, 2012 Author Share Posted May 17, 2012 This doesn't work anymore... I've confirmed that ASC(§) is still 0167, and I've also tried with the unicode (which is 167) So basically HotKeySet("{PAUSE}", "EndScript") $Key = Chr(0167) HotKeySet($Key, "fSpace") While 1 Sleep(100) WEnd Func EndScript() Exit EndFunc Func fSpace() MsgBox(0, "title", "yeah") EndFunc No longer works to capture the key left of the 1 on a keyboard set to German (Switzerland). I've also tried with $key=ChrW(167). In those 6 years my OS changed to Win 7 64bit, my computer changed... Anyone know of any code changes that might have brought this about? Or have any suggestions? Thanks in advance Link to comment Share on other sites More sharing options...
ProgAndy Posted May 17, 2012 Share Posted May 17, 2012 My german keyyboard layout has the circumflex (^) next to the key for 1. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes 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