AutoHotkey Community

It is currently May 26th, 2012, 9:25 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: July 30th, 2009, 3:23 pm 
Offline

Joined: May 24th, 2009, 1:23 pm
Posts: 89
Location: Bærum, Norway
With the Send command you sure can do a lot of nice stuff! Send all sorts of media key presses, for instance. Well... not absolutely all sorts it turns out. Some boards will have keys with 'open' and 'new' for instance. Fancy.

Microsoft has defined a set of commands of which the usual media keys sendable in AHK so far are just a subset: The WM_APPCOMMAND (http://msdn.microsoft.com/en-us/library/ms646275(VS.85).aspx) messages. Some of those would be rather nice to Send, as a quick way of telling apps to do something. I'm sure someone would love the equalizer or mail handling 'keys' available in there. I'd like them!

So, would it be hard to make the Send command accept an {APP %commandnamehere%} syntax?

Yes, I know that you can post messages. I was thinking of getting this into the Send command for remapping purposes. Aye or nay?

_________________
Better burden you cannot carry than man-wisdom much -- Hávamál


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 30th, 2009, 8:06 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Is this not quite the same?
AutoHotkey Help wrote:
{ASC nnnnn} Sends an ALT+nnnnn keypad combination, which can be used to generate special characters that don't exist on the keyboard. To generate ASCII characters, specify a number between 1 and 255. To generate ANSI characters (standard in most languages), specify a number between 128 and 255, but precede it with a leading zero, e.g. {Asc 0133}.

To generate Unicode characters, specify a number between 256 and 65535 (without a leading zero). However, this is not supported by all applications. Therefore, for greater compatibility and easier sending of long Unicode strings, use "Transform Unicode".

{vkXX}
{scYYY}
{vkXXscYYY}
Sends a keystroke that has virtual key XX and scan code YYY. For example: Send {vkFFsc159}. If the sc or vk portion is omitted, the most appropriate value is sent in its place.

The values for XX and YYY are hexadecimal and can usually be determined from the main window's View->Key history menu item. See also: Special Keys


_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 8:28 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Some APPCOMMAND_' values have equivalent virtual keycodes defined in the Windows SDK and for that reason have already been assigned names in AutoHotkey. Specifically:
Quote:
The following exist only on Multimedia or Internet keyboards that have extra buttons or keys:
Browser_Back
Browser_Forward
Browser_Refresh
Browser_Stop
Browser_Search
Browser_Favorites
Browser_Home
Volume_Mute
Volume_Down
Volume_Up
Media_Next
Media_Prev
Media_Stop
Media_Play_Pause
Launch_Mail
Launch_Media
Launch_App1
Launch_App2

Source: List of Keys and Mouse/Joystick Buttons for Hotkeys and Macros


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 11:16 am 
Offline

Joined: May 24th, 2009, 1:23 pm
Posts: 89
Location: Bærum, Norway
So what you're saying is that you can't send, say, a "New", "Bass boost" or "Redo" virtual key like you can send a "Favorites" or "Volume Up"? Not just in AHK, but in Windows in general?

Too bad there isn't an "Undo" and a "Redo" key at least. That'd be nice. I send Alt-Back and Ctrl-Y which usually works well enough, but still.

_________________
Better burden you cannot carry than man-wisdom much -- Hávamál


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 12:51 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Yes, but specifically because there are no such keys.

What's the problem with sending keystrokes? WM_APPCOMMAND is no better: for it to work, the application has to specifically handle it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2009, 12:01 pm 
Offline

Joined: May 24th, 2009, 1:23 pm
Posts: 89
Location: Bærum, Norway
One problem with sending keystrokes is that Ctrl-Y may be Redo in one application but it's not really standardized and we all know that different apps have different hotkey strategies; an APPCOMMAND_REDO should, on the other hand, ideally be understood by all Windows-compatible apps.

Are you saying that the ability to adhere to this isn't implemented in a significant percentage of Windows programs? I'd think that many of the much-used programs would play nice at least; of course I wouldn't expect it to work with a lot of legacy apps or Sourceforge projects. If it'd work in, say, my mail app, web browser and office suite that'd be more than enough for me and most users to make it worthwhile I'd guess.

_________________
Better burden you cannot carry than man-wisdom much -- Hávamál


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2009, 10:43 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Quote:
If it'd work in, say, my mail app, web browser and office suite
Why don't you try it and let us know?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group