31290

Keyboard remapping

9 posts in this topic

#1 ·  Posted (edited)

Hi There, 

I'm currently rebinding some of my keys (multimedia ones) and I have two keys that handle the Zoom (+ & -)

download.thumb.jpg.29e0df8a0ca699e8fc281 (just after the calc key)

 

I looked everywhere (in the help file and on Google) but I was not able to find the matching code.

Do some of you could have a little idea on how to get their "name" so I'll be able to remap them?

Thanks ;)

Edited by 31290

~~~ Doom Shall Never Die, Only The Players ~~~

Share this post


Link to post
Share on other sites



Every keyboard has different layout of Special Keys... That is all I know, Sorry :)

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Hi, 

Thanks all for your answers.

Unfortunately, I don't have access to this page here @ work and could someone download the UDF and copy/paste it's content here?

Thanks you :)


~~~ Doom Shall Never Die, Only The Players ~~~

Share this post


Link to post
Share on other sites

I can't reach it either but a forumsearch gives this post which is probably it.

@Exit

I think your server is down.

Yes, the Server seems to be down. But your link to the post is valid.

I will look for a new free Server to hold my sources. Any suggestions?


My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

Unfortunately, I don't have access to this page here @ work and could someone download the UDF and copy/paste it's content here?

The Server is down. I migrated the Code to another Server:

http://h--e.de/autoit/UDF/WhatKeyIsPressed.html

Here the source:

;   WhatKeyIsPressed.au3      Author: Exit     http://www.autoitscript.com/forum/user/45639-exit/
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hDLL = DllOpen("user32.dll")
GUICreate("Press any key(s) to show hex key codes ", 315, 315, -1, -1, Default, $WS_EX_TOPMOST)
Opt("GUICloseOnESC", 0)
Local $a[16][16]
For $y = 0 To 15
	For $x = 0 To 15
		$a[$y][$x] = GUICtrlCreateLabel(Hex($y * 16 + $x, 2), $x * 20, $y * 20, -1, -1)
		GUICtrlSetState($a[$y][$x], $GUI_HIDE)
	Next
Next
$keydump = GUICtrlCreateEdit("", -50, 0, 0, 0)  ; Out of windows boundary. Will accept keystrokes.
GUISetState(@SW_SHOW)
While True
	If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
	For $y = 0 To 15
		For $x = 0 To 15
			GUICtrlSetState($a[$y][$x], (_IsPressed(Hex($y * 16 + $x, 2), $hDLL) ? $GUI_Show : $GUI_HIDE))
		Next
	Next
WEnd
DllClose($hDLL)

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

Hi There, 

I'm currently rebinding some of my keys (multimedia ones) and I have two keys that handle the Zoom (+ & -)

download.thumb.jpg.29e0df8a0ca699e8fc281 (just after the calc key)

 

I looked everywhere (in the help file and on Google) but I was not able to find the matching code.

Do some of you could have a little idea on how to get their "name" so I'll be able to remap them?

Thanks ;)

Perhaps this helps:

_HotKey("{ESC}")
_HotKey("{VOLUME_UP}")
_HotKey("{VOLUME_DOWN}")
Func _HotKey($hotkey = "")
;       ! ALT  + SHIFT  ^ CONTROL  # WinKey
    Switch @HotKeyPressed
        Case "{ESC}"
            Exit 0*MsgBox(64 + 262144, Default, "Exit", 1)
        Case "{VOLUME_UP}"
            MsgBox(64+262144, Default, "Volume Plus pressed",0)
        Case "{VOLUME_DOWN}"
            MsgBox(64+262144, Default, "Volume Minus pressed",0)
        Case Else
            If Not IsDeclared("hotkey") Then Return MsgBox(16 + 262144, Default, "No CASE statement defined for hotkey " & @HotKeyPressed)
            If HotKeySet($hotkey, "_Hotkey") = 0 Then Return MsgBox(16 + 262144, Default, "Hotkey " & $hotkey & " invalid or set by another application.")
    EndSwitch
EndFunc   ;==>_HotKey

While Sleep(100)     ; here should be your application.
WEnd                 ; meanwhile, here is a dummy loop.

 


My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

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

  • Similar Content

    • Tarakesh
      By Tarakesh
      Hi,
      First of all I would like say infinite thanks to the team involved in designing this great tool.
      Here is my problem
      1. Press windows button
      2. ESC
      3. TAB
      4. It will take me to the first pinned icon in the taskbar
      5. If I I do SHIFT F10 which usually opens context menu like  right click of the mouse.
      6. For one of the application I am using it does not support  Shift + F10 context menu rather it listens to only mouse right click event.
      7. I do a search in a tree view of my application and the search item is selected or focused
      8. For eg

           User1

           User2
           User3
      Now if I search for User1 the tab or focus move to User 1 (Red)
           User1

           User2
           User3
      If I search for User3 the tab or focus moves to User 3
      Now my question is how can I move the mouse automatically go to the focused item on the window. Such that during automation I can issue MoveClick("{RIGHT}") as {SHIFT F10} is not working from the keyboard. It is a java app, unfortunately it is not honoring the right click events from keyboard to open the context

      WinMinimizeAll();
      Send("^{ESC}")
      Sleep(200)
      Send("{ESC}")
      Send("{TAB}")

      the above scripts take the tab to the first pinned icon in the taskbar. Now i want
      MouseMove( "move to tab" selection")

      Regards,
      Tarakesh
    • WoodGrain
      By WoodGrain
      Hi guys,
      I've seen the @kblayout macro, but the information I'm after is the keyboard layout (aka "Input Method") so I can detect if I'm using "US Keyboard" or "United States-Dvorak Keyboard" rather than 00000c09 or 00000409 which relate to languages such as EN AU or EN US for example.
      For example I have 1 language set up (English Australia) in my regional settings, but then under the language I have "US Keyboard" and "United States-Dvorak Keyboard" setup, so that when I press WIN+SPACE I can toggle between them.
      Effectively I want a way of determining if I'm running qwerty or dvorak.
      Thanks guys!!
    • GreenSparks
      By GreenSparks
      Hi!
      I post here because i was wonderring if someone in this forum could help me with my script.
      What i'm trying to do, is to basically install a new keyboard layout in Windows and activate it. I want to acheive by the registry or the command line, but not with the autoit automation tools, i don't find it stable...
      Thanks for your help and have a good day!
    • duckling78
      By duckling78
      Here's a hacky script I made to make the music key on my keyboard click the back button on my Chrome browser.  You need to compile the script in to an exe, and associate "cda" file extension to the executable.  Note- this also means you can reassign the music key on your keyboard to whatever executable you want using this method!
      AutoItSetOption("WinTitleMatchMode", 2) HotKeySet("{Escape}", "exitScript") $chromePos = WinGetPos("Chrome") If (@error <> 0) Then ConsoleWriteError("Can not find Chrome window - WinGetPos returned @error: " & @error & @CRLF) Exit EndIf $originalMousePos = MouseGetPos() MouseClick("primary", $chromePos[0] + 20, $chromePos[1] + 45, 1, 2) MouseMove($originalMousePos[0], $originalMousePos[1], 2) Func exitScript() ConsoleWrite("Exiting script..." & @CRLF) Exit EndFunc Yay AutoIt3 community.  Unfortunately, for the most part at work I've moved on to OSX machines (meh).  Seems like that's what all the companies are developing on lately.
    • Aiakonai
      By Aiakonai
      Hello,

      I am trying to create an input box that when a user types something like the character "." that it will prevent that character from entering the input box and display a message 
      stating why the input was prevented. Something like what $ES_NUMBER style does for the input box, but for a floating point number. I can work out the logic of how to do that, but
      I am not yet sure how to correctly capture keyboard input before it arrives IN the input box. This should only run on the particular input box in question as it is an aid to help clean 
      up user input before it gets sent to a SQL query.
       
      I was hoping for something like:
       
      $msg = GUIGetMsg() Switch $msg Case $keyboardInput ; pre processing function called here I have searched for something similar to this but I cannot seem to find one that does exactly what I am looking for. Any help is appreciated.
       
      Thanks,
      K