Sign in to follow this  
Followers 0
Miranda

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

16 posts in this topic

#1 ·  Posted (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 by Miranda

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

post your code so we can help u.. we need 2 see where u made your mistake :whistle:

Edited by Golbez

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Miranda

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by Miranda

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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...

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Works like a charm, thanks a ton! :P

Miranda

Edited by Miranda

Share this post


Link to post
Share on other sites

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 ;)

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0