Jump to content

Need a script that type @ - (Moved)


Recommended Posts

Hello everyone!

Newbie here. Something happened a while ago with my pc. I can´t get my keyboard to type @
I am only able to type it when using a virtual keyboard. Why this is, is beyond me. So...until I know why, I would like a script doing this:

When I press a key on the keyboard, it will type @ 

I have searched help for Autoit and googled it but it has only made me more confused. How would you do it?

Thanks!

Link to comment
Share on other sites

Here, on German keyboard layout, the @ is at alt Q. 
If, for some reason the input language is changed to something else (by mistakenly pressing the windows + space key) the @ jumps to somewhere else.

Maybe it is the case on your system ?

 

If you really want to have a key permanently changed, then it is better to use an utility like https://github.com/randyrants/sharpkeys . you can change any key you want to be your next @ key. A single script for a single key is not so useful, imho.

Some of my script sourcecode

Link to comment
Share on other sites

On 6/14/2023 at 11:10 AM, matteus_71 said:

How would you do it?

Here is a script if you really want it ; control key is a @ ; escalator is script Exit
https://www.autoitscript.com/autoit3/docs/libfunctions/_IsPressed.htm

but as other people suggested you should probably find a better way to fix  your issue 

 

<Misc.au3>

HotKeySet("{ESC}", "TerminateScript")
Global $shouldRun = True

While $shouldRun
    If _IsPressed("11") Then ; Check if Control key is pressed
        Send("@")
        Sleep(100) ; Pause for 100 milliseconds to prevent rapid repetition
    EndIf
    Sleep(10) ; Pause for 10 milliseconds to reduce CPU usage
WEnd

Func TerminateScript()
    $shouldRun = False
    Exit
EndFunc

let me know if it worked

 

Edited by 20Ice18

❤️

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