Sign in to follow this  
Followers 0
Bluesmaster

Custom Modifier or AHK IPC

18 posts in this topic

#1 ·  Posted (edited)

Hello Community,

I have a lot of macros written in AutoIt but I am running out of Hotkeys to launch them and they are sometimes very unergonomic.

In Autohotkey ( sorry :) ) one can use any combination of keys as hotkeys, but I dont like it as scripting language.

- Can one achieve such hotkeys (like A + B  in AutoIt without "_isPressed"  heavy-weight solutions (Maybe hook or something equivalent) ?

- If not, can I call autoIt-Fcns (from running script!) from autohotkey through some kind of   Inter Process Comunication (IPC) ?

  ( but no "send" or "clipboard" solutions as this could cause to much conflicts)

any solutions, ideas or workarounds are welcome

 

thanks in advance

Bluesmaster

Edited by Bluesmaster

My UDF: [topic='156155']_shellExecuteHidden[/topic]

Share this post


Link to post
Share on other sites



Take a look at Yashied's execellent >HotKey UDF (note: on Win7+ I had some issues with hotkeys not working anymore after a time, I "solved" this with an adlib de-registering and re-registering the hotkeys every 3 minutes or so, see example below).

AdlibRegister("_Reregister_Hotkeys", 3 * 60 * 1000) ; "Should" fix lost hotkeys issue on Win7+
Func _Reregister_Hotkeys()
    _HotKey_Disable()
    _HotKey_Enable()
EndFunc   ;==>_Reregister_Hotkeys

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

 

any solutions, ideas or workarounds are welcome

 

Sounds like it might be time for a new keyboard.... :ermm:

Might I suggest the G15 From Logitech (no affiliation) tell them unka billo sent you ;-)

Even though your device is ready to use straight from the box, one of its great strengths is that you can customize it to suit you and your gaming... 
Most Logitech® gaming devices feature programmable G-keys or buttons. The default functionality of its G-keys/buttons are specified in the default profile 'Default Profile'. 
If your device has M-keys, they are labeled M1, M2, and so on. You can customize the G-keys/buttons and M-keys on an application specific basis using the Logitech Gaming Software. The M-keys let you program different sets of assignments for all of your G-keys/buttons. At any given time the G-keys are in one of the modes and the relevant LED (M1, M2, and so on) is lit to indicate the current mode. To change mode, simply press the relevant M-key. 
The MR key can be used to record quick, on-the-fly macros which can be assigned to any of the G-keys, overriding assignments made in the current profile. 
For more information on G-keys/buttons and M-keys, see Using the G-keys, Using mouse buttons and Using the M-keys. 
Remember that each application you use – including each game you play – can have one or more profiles defined that contains G-key/button customizations specific to that application. See Using profiles for more information. 
Note:
As well as customizing G-keys/buttons, you can also adjust the way you use your device's LCD GamePanel display, if it has one.
Edited by billo

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@JohnOne:

HotStrings are not really what I am searching for, keys should be pressed together not in series,

for such purposes I use PhraseExpress

@KaFu:

I have seen this udf during my research but unfortunately:

Here is what you can not do by using this library:

  • Use more than one function key in the hotkey. For example, ALT+A+B, F1+F2, etc.

 

 

something like

_HotKey_Assign(BitOR($CK_A , $VK_B), 'Message', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL))

did not work for me as it just fires on "B" not on "A+B"

 

@billo:

I thought about the G15 a  while ago, but it is  unnecessary as just 1 aditional modifier (autoHotkey) can totaly

replace it by conserving desk space. And a script is more portable than a device :) . But I use G600 as mouse.

 

 

Hm...any other proposals? Any idea for communication with AHK?

 

Btw: I thinK autoIt could profit a lot from include some of the hotstring, rekeying ...capabilities of AHK.

But I know this is not easy to implement.

Edited by Bluesmaster

My UDF: [topic='156155']_shellExecuteHidden[/topic]

Share this post


Link to post
Share on other sites

I hesitate to mention this because it seems so obvious but

If you need a lot of hotkeys make a hotkey set.

I used this method for a script at work:

All F keys are Functions 1-12

All <CTRL> Fkeys are also Functions 13-24

need I continue?...

Share this post


Link to post
Share on other sites

Hi,

With the HotKey UDF you can register any key combination, but you will need to modify the function with for example a buffer.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

@billo:

- I need global Hotkeys that do not conflict with hotkeys of  applications

- I need ergonomic hotkeys that can be pressed without looking to the keyboard

- I need potentially more than 200 hotkeys

@JohnOne:

maybe we differ about the word "easy". Easy ist:  b+v::c  (AHK)

AutoIt:

#include <Misc.au3>

HotKeySet( "b" , "b_Pressed" )


Local $hDLL = DllOpen("user32.dll")

Func b_Pressed()

    $somethingElsePressed = 0

    While _IsPressed( "42", $hDLL ) ; 42 = b

        if _IsPressed( "56" , $hDLL )  Then  ; 56 = v
            Send( "c" )
            $somethingElsePressed = 1
            ExitLoop
        EndIf

        Sleep( 10 )

    WEnd

    if not( $somethingElsePressed ) Then
        HotKeySet( "b" )
        Send( "b" )
        HotKeySet( "b" , "b_Pressed" )
    EndIf

EndFunc


While True
    Sleep( 1000 )
WEnd

and there are conflicts. For example pressing  " b a "  fast (when writing)  it gets    " a  b ". 

And I cannot surpress the "v". I could with also setting it a hotkey, but I that could destroy its original hotkey,

or I could delete it. But that would lead to "browse back" in Browsers... and so on and so forth....

Not meantioning the mass of code lines for such a small task and its innherent complexity


My UDF: [topic='156155']_shellExecuteHidden[/topic]

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

- I need global Hotkeys that do not conflict with hotkeys of applications

- I need ergonomic hotkeys that can be pressed without looking to the keyboard

- I need potentially more than 200 hotkeys

 

200 Ergonomic Hotkeys.....

....Plug in a second Keyboard

Edited by billo

Share this post


Link to post
Share on other sites

@billo

:) thanks for your care. The Point is I do very well with my concept with AHK.

At least the layer-concept is not my idea: http://en.wikipedia.org/wiki/Keyboard_layout#Neo

I want to get rid of AHK and unite macro launching and rekeying together in AutoIt,

but after this discussion I am very uncertain that it is possible.

Anyone at least knows a method for AHK to communicate with AutoIt? Some kind of:

a +  b :: launchFunctionInAutoIt( "myScript.au3" , "myFunction" )

or

a + b :: sendMessageToAutoIt( "myScript.au3" , "Test" )

 

I am a noob, I need a  push into the right direction


My UDF: [topic='156155']_shellExecuteHidden[/topic]

Share this post


Link to post
Share on other sites

Yes well you will have to take a look at the hotstrings idea from John.

Seen a HotStrings (or similar name) UDF in example scripts once, perhaps that might help you.

 

>A link to the post

I will be playing with it a little later on so let us know if you made any progress..

Good Luck !

Bill

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I will have a look to that again  (JohnOne proposed it at the beginning but I rejected it because the keys are pressed one after another there and not together)

If you have a working snippet I would be very curios about it.

Else I thought I will do some research about keybordhooking first and then doing something with a buffer.

But thats again a lot of time for testing ... The intension of my request was to find out if somebody had solved this problem once.

thanks

Bluesmaster

Edited by Bluesmaster

My UDF: [topic='156155']_shellExecuteHidden[/topic]

Share this post


Link to post
Share on other sites

IMO the idea of having a hotkey that calls a function every time you hit "A" and then "B" which is what this does seems like it will eventually get annoying when trying to type normally.

In which case I was thinking of adding an identifier (for lack of jargon) key that you push before you are going to push your HK that tells your script to get ready for the HK

I may play around with that later if I have time...

Here your snippet; don't forget, it only works with the HotSting.au3 UDF

#include <HotString.au3>

HotStringSet("ab", "examplefunction")

While 1
    Sleep(10)
WEnd

Func examplefunction()
    MsgBox(0,"","You typed callme! :)")
EndFunc

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Your proposals are all very good. The Problem is, that I have a Hotstring system already ("PhraseExpress"), it also works well.

I really just search for the cutting edge efficency of one single press ( sorry for my exclusive needs :) )

And not moving my fingers to "win" or" "control"  which hurts when you do it all day long.

Maybe I let AHK do what it can do best and just forward the recognized ( A +  B ...) to AutoIt .

But how? How can I send Messages from AHK to AI? Maybe WindowMessages? Shared Memory?

Unfortunately I do not know anything about such technologys.

Edited by Bluesmaster

My UDF: [topic='156155']_shellExecuteHidden[/topic]

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