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
      I have a situation where the desktop is designed in java swings. The nodes JTree is not allowing me to do checkbox selection using "spacebar". I am able to navigate through the nodes using up, down arrow and a tab. When I reach to the desire node selection, mouse left click is not working due a flaw a JTree core. However since it is selected, if mouse cursor auto moved to the position of the selection and send a "click"  then it should be solved. Any ideas much appreciated. 
      the problem with having fixed coordinates are the main windows is divided to 2panels where right panel containing this JTree can be expanded or shrink-ed.

    • myspacee
      By myspacee
      Hello,
      need help to remap '<' button and SHIFT+'<'
      I made a little editor that allows to my users to write using proprietary codes.
      In production we have 2 keys/symbols that i want to 'emulate'. So, when is press on my keyboard :
      < = « SHIFT+< = » Try to use help example _IsPressed :
       
      #include <Misc.au3> #include <MsgBoxConstants.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("10", $hDLL) Then ConsoleWrite("_IsPressed - Shift Key was pressed." & @CRLF) ; Wait until key is released. While _IsPressed("10", $hDLL) Sleep(250) WEnd ConsoleWrite("_IsPressed - Shift Key was released." & @CRLF) ElseIf _IsPressed("1B", $hDLL) Then MsgBox($MB_SYSTEMMODAL, "_IsPressed", "Close the application.") ExitLoop EndIf Sleep(250) WEnd DllClose($hDLL) but how manage keys combination ?
      thank you for any help,
      m.
    • 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!