help with key combination condition

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: help with key combination condition

Re: help with key combination condition

Post by swagfag » 18 Jun 2018, 15:50

kheerand wrote:It didn't quite work. It still didn't caputure ^J + ^J and execute the send command. :(

it works for ^j + ^j

Re: help with key combination condition

Post by Cerberus » 17 Jun 2018, 20:48

The problem is that the second parameter after the Input command, the output variable (the parameter command, in your script), only outputs characters, not hotkeys that don't produce a (visible?) character. And ^j does not produce a character, it's just a hotkey. From the documentation:
OutputVar does not store keystrokes per se. Instead, it stores characters produced by keystrokes according to the active window's keyboard layout/language. Consequently, keystrokes that do not produce characters (such as PageUp and Home) are not stored (though they can be recognized via the EndKeys parameter below).


The proper command to use in your script would probably be the Hotkey command, to create temporary hotkeys, rather than the Input command. But it can still be done with the Input command if you use A_ThisHotkey instead of the output variable. This works for me:

Code: [Select all] [Expand]GeSHi © Codebox Plus



I've also added the option M to the Input command, or it didn't work. Lastly, I've corrected an error in your code: T5 is an option just like L1 and M, and all options are one parameter together, so there shouldn't be a comma between any of them.

(I've also flagged this post to be moved to the "Ask for Help" forum.)

Re: help with key combination condition

Post by kheerand » 17 Jun 2018, 09:56

Thanks for you script swagfag. It didn't quite work. It still didn't caputure ^J + ^J and execute the send command. :(

Re: help with key combination condition

Post by swagfag » 11 Jun 2018, 06:54

yeah idk if id necessarily use an input box for this:

Code: [Select all] [Expand]GeSHi © Codebox Plus

help with key combination condition

Post by kheerand » 11 Jun 2018, 06:16

Hi folks,

Somewhat of a newbie to AHK. I am trying to have the key combination of ^J followed by another key to take some action in a software application that I commonly use. The code I've got is,

Code: [Select all] [Expand]GeSHi © Codebox Plus



While this works for the key combination of ^j + 2 or ^j + k, it doesn't work for ^j + ^j. What am I doing wrong here?

Thank you in advance.

Regards
Kheeran

Top