Jump to content

Problems using a hotbutton (` on german keyboard: §)


Recommended Posts

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 by Miranda
Link to comment
Share on other sites

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

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 by Miranda
Link to comment
Share on other sites

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? :P

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... :nuke:

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

I WON'T shut up just yet :P 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 by Miranda
Link to comment
Share on other sites

I WON'T shut up just yet :nuke: 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}")

:P
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

Was a no-go :P

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

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

  • 5 years later...

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...