Jump to content

Possible to map a programmable keyboards macro keys?


Recommended Posts

I recently purchased a keyboard that has programmable macro keys on it.  I guess it is a gaming keyboard, a cheap brand from walmart. I am not a gamer and am instead using the keys for Notepad++ and other software I use regularly.  Their software kind of sucks and they do not support it.  I would like to create an Autoit version for creating a library of macros and key combonations but when I use the example in the manual that records keypresses these macro keys do not show up.  Is there a way to map them in Autoit?

I do not understand hardware level programing at all or how to use DLL's other than to get icons out of them.  Thoughts,. suggestions?

Link to comment
Share on other sites

It has three memory buttons, each one is a new section so you can have a total of 15 macros to a profile and you can have 5 profiles.  I would like to create my own version of this to make it unlimited and be able to program specific keys and not just macros of key combinations with delays.

Link to comment
Share on other sites

It is also a back lit keyboard with various color combinations their software handles. I don't really care about that more the programmable keys than the lights.

Edited by iAmNewbe
typo
Link to comment
Share on other sites

I see you didn't got an answer. Since I would like to help you I might have a suggestion not connected with autoit. I had the similar problem which I solved with applicati0n HotkeyP. Maybe there you could detect keys and then code something for keyboard in autoit? I hope I didnt broke any rule by telling you that.

Link to comment
Share on other sites

11 hours ago, Skysnake said:

I looked at those functions and if I understand correctly you already need to know what the key information is.  That is the problem, I do not know and I have no idea how to get it. They either do not provide any id OR Autoit has no function that can retrieve it that I have been able to find.

As for the knowing what I want to do, I want to program these keys and map them to an existing key like CTRL or Shift or the letter A and also be able to map key combinations or macros to them.

Edited by iAmNewbe
Link to comment
Share on other sites

Okay

Can you do create macro in AutoIt and map  to a standard KNOWN KEY? Like ALT+A for instance?

I am sure once you understand the mechanism, then extrapolating from there will be easy.  Bear in mind that those "custom keys" might just be "macros" for standard key combinations.  Remember that keyboard must plug into standard hardware.  So they must be able to process those keys in a away that standardized hardware will understand.

What I mean is that your keyboards custom key "Custom 1" might simply be macro for a standard key combo, such as "Alt+A" .  Press keyboard button "Custom 1" -> keyboard converts to "Alt+A" and send to processor...

In addition, AutoIt is not designed, nor intended as a hardware management / accelerator tool, so no surprises there.

Good luck.

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

I know how to create hotkeys and macros in Autoit. I do not know how to map them to these keys as they  do not show up when pressed.

What you said is probably true but the software that came with the keyboard has to somehow connect to the keyboard to know what button is being pressed. That process is a mystery to me.  Once a macro is created and assigned to one of these keys via the enclosed software then what shows up in Autoit keyboard polling is just the combination of key presses assigned to the individual key.

Creating the macros is not the problem. Knowing when to trigger them based on these custom keys is because like I said they do not show up so no id to assign anything to.

Link to comment
Share on other sites

7 minutes ago, Skysnake said:

In addition, AutoIt is not designed, nor intended as a hardware management / accelerator tool, so no surprises there.

Good luck.


I don't know, there are a lot of functions to do just that in Autoit, mouse and keyboard.

Link to comment
Share on other sites

52 minutes ago, Fr33b0w said:

Have you give it a go with hotkeyP for detection?

The application found: Sleep, Help, Hp, Shortcut 1, Shortcut 2, Find, Print, Fax, Shopping, Entertainment, Finance, Connect, Search, People, E-Mail, Stop, Rewind, Play/Pause, Fastforward, Eject keys on my keyboard.  Going to rate hotkeyP 5 of 5 bananas.

Link to comment
Share on other sites

3 hours ago, kylomas said:

"I do not know how to map them to these keys as they  do not show up when pressed.".

Show up in what/where?

 

Autoit keyboard polling code writing keys pressed to console.

Since you do not seem to understand here is a copy past of one of the programs directly from the manual. There are others, this is just one example.
 

#include <GUIConstantsEx.au3>
#include <WinAPISys.au3>
#include <WindowsConstants.au3>

GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'))
GUIRegisterMsg($WM_KEYDOWN, 'WM_KEYDOWN')
GUISetState(@SW_SHOW)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func WM_KEYDOWN($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam

    ConsoleWrite(_WinAPI_GetKeyNameText($lParam) & @CRLF)
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_KEYDOWN

 There does not seem to be a way to retrieve the unassigned keys from Autoit, which means I can not get an id to assign anything to or trigger an action when one of the keys are pressed.  This is what I want to do.

Edited by iAmNewbe
replaced code example with better example
Link to comment
Share on other sites

9 hours ago, Fr33b0w said:

Well it helped me too for some sonyplaystation pad but you can redefine keys in it and assign those keys in autoit. At least until other solution is found considering autoit.

I can not find the website for this program there seems to be multiple versions around which none of them I would want to come near my windows 10 computer at all.


I can assign a macro of keys to each programmable key via the software that came with the keyboard but not something like A1.. it would be A then the number 1.  I maybe able to create a combination like this for each key that I maybe able to capture with Autoit, will have to experiment and it would mean I would not be able to use the software that came with the keyboard again after this or it would erase the key assignments.  Will have to experiment.

Edited by iAmNewbe
Link to comment
Share on other sites

I know the keyboard. I own one. I see what the poster has in mind. I suspect the micro controller on the keyboard is sending specific code to the PC and the app that is written for that code is reading it. From what you are saying - you want to read that code being sent to the PC, and have a different action take place. The ONLY thing I can think of is you have to decompile the app that reads that code being sent by the keyboard and rewrite it. That is way beyond my pay grade.

If I was you - I know that isn't what you want but you can look to see what windows you have active and then see what function keys are not assigned for said window. You could then use them for what you have in mind

Link to comment
Share on other sites

55 minutes ago, Bert said:

I know the keyboard. I own one. I see what the poster has in mind. I suspect the micro controller on the keyboard is sending specific code to the PC and the app that is written for that code is reading it. From what you are saying - you want to read that code being sent to the PC, and have a different action take place. The ONLY thing I can think of is you have to decompile the app...

If there are codes being sent then there has to be a way to retrieve that information without decompiling anything.

The other possibility is that they are blank and the software that comes with the keyboard programs these keys and what is returned is the recorded macro key combinations. If that is the case then there really isn't much I can think of that can be done.

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