AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Could the Send command include all WM_APPCOMMAND messages?

 
Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
DreymaR



Joined: 24 May 2009
Posts: 89
Location: Bćrum, Norway

PostPosted: Thu Jul 30, 2009 2:23 pm    Post subject: Could the Send command include all WM_APPCOMMAND messages? Reply with quote

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
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Thu Jul 30, 2009 7:06 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7295
Location: Australia

PostPosted: Fri Jul 31, 2009 7:28 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
DreymaR



Joined: 24 May 2009
Posts: 89
Location: Bćrum, Norway

PostPosted: Fri Jul 31, 2009 10:16 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7295
Location: Australia

PostPosted: Fri Jul 31, 2009 11:51 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
DreymaR



Joined: 24 May 2009
Posts: 89
Location: Bćrum, Norway

PostPosted: Mon Aug 03, 2009 11:01 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7295
Location: Australia

PostPosted: Mon Aug 03, 2009 9:43 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group