拦截'多媒体键' [英] Intercepting 'multimedia keys'

查看:88
本文介绍了拦截'多媒体键'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




有没有人知道是否有可能(如果是这样,如何)拦截按下

''多媒体键'你在键盘上找到了吗?好奇心比什么都重要。只有

制造商似乎把他们自己的随机gubbins放在他们的键盘上,所以

可能没有任何标准。显然他们的应用程序

能够听到按钮,所以它可以在某种程度上。

.NET或Win32欢迎的可能性(因此交叉发布 -

道歉)。


干杯!


史蒂夫

解决方案

" Steve McLellan" < sjm.NOSPAM AT fixerlabs DOT com>写在消息

新闻:ud ************** @ TK2MSFTNGP15.phx.gbl ...

有谁知道是否有可以(如果是的话,如何)拦截你在键盘上找到的多媒体键上的按键?


如果供应商遵守规则并且有问题的o / s是ME,2K,

XP或2K + 3,简单的事情要做的是回复WM_APPCOMMAND

消息。此时,键盘软件已将击键消息映射到诸如Play之类的应用程序命令中。例如。


增强型键盘上的标准键在< winuser.h>中定义:


#define VK_BROWSER_BACK 0xA6

#define VK_BROWSER_FORWARD 0xA7

#define VK_BROWSER_REFRESH 0xA8

#define VK_BROWSER_STOP 0xA9

#define VK_BROWSER_SEARCH 0xAA

#define VK_BROWSER_FAVORITES 0xAB

#define VK_BROWSER_HOME 0xAC

#define VK_VOLUME_MUTE 0xAD

#define VK_VOLUME_DOWN 0xAE

#define VK_VOLUME_UP 0xAF

#define VK_MEDIA_NEXT_TRACK 0xB0

#define VK_MEDIA_PREV_TRACK 0xB1

#define VK_MEDIA_STOP 0xB2

#define VK_MEDIA_PLAY_PAUSE 0xB3

#define VK_LAUNCH_MAIL 0xB4

#define VK_LAUNCH_MEDIA_SELECT 0xB5

#define VK_LAUNCH_APP1 0xB6

#define VK_LAUNCH_APP2 0xB7


所以,回答你的问题拦截他们你可以过滤它们

处理WM_KEYDOWN我认为这是在95和98上完成的。但是你

可能最终绊倒键盘制造商的软件(比如

Intellimouse,比如说)如果你这样做的话。

好​​奇心比什么都好。




As Martha可能会说,好奇心是一件好事。 < g取代;如果你的好奇心不是很好,你可能想看看这里:

http://www.microsoft.com/whdc/device/input/w2kbd.mspx


问候,



>新闻:ud ************** @ TK2MSFTNGP15.phx.gbl ...

有谁知道它是不是可以(如果是这样,如何)拦截你在键盘上找到的''多媒体键'上按

如果供应商按规则玩,如果有问题的是我的,



2K,XP或2K + 3,简单的做法是响应WM_APPCOMMAND
消息。此时,键盘软件已将按键消息映射到诸如播放之类的应用程序命令中。例如。


顺序,可能不是,是的,确定。

增强型键盘上的标准键在< winuser.h>中定义:

所以,回答你的问题拦截你可以在处理WM_KEYDOWN时过滤它们
,我认为这是在95和98上完成的。但是你可能最终会绊倒键盘制造商的软件(比如
Intellimouse,如果你这样做的话)。


他们最好不要妨碍我! :-)他们的软件一直都在



尚未满足,你可能想看看这里:

http://www.microsoft.com/whdc/device/input/w2kbd.mspx



Martha,我很害怕,输给了跨大西洋的语言障碍或者我的总体欠款b $ b缺乏睡眠:-)感谢您的链接 - 看起来...... '全面'':)


谢谢!


Steve


提防对于音量级别更改键,它们经常被滥用(至少我看到的是b
)当放在扬声器上时控制主音量级别。许多

的用户感到困惑并开始搜索您的支持电子邮件

地址如果您的应用程序碰巧让他们改变自己的私人

声级,因为应用应该是良好的行为。


Hi,

Does anyone know if it''s possible (and if so, how) to intercept presses on
''multimedia keys'' you find on keyboards? Curiosity more than anything. Only
manufacturers seem to put their own random gubbins onto their keyboards, so
presumably there isn''t any kind of standard. Obviously their applications
are capable of listening to the buttons so it''s possible at some level.
Possibilities in either .NET or Win32 welcome (hence the cross post -
apologies).

Cheers!

Steve

解决方案

"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in message
news:ud**************@TK2MSFTNGP15.phx.gbl...

Does anyone know if it''s possible (and if so, how) to intercept presses on
''multimedia keys'' you find on keyboards?
If the vendor is playing by the rules and if the o/s in question is ME, 2K,
XP or 2K+3, the simple thing to do is to respond to the WM_APPCOMMAND
message. At that point the keyboard software has mapped the keystroke
message into an application command like "Play" for example.

The standard keys on the enhanced keyboards are defined in <winuser.h>:

#define VK_BROWSER_BACK 0xA6
#define VK_BROWSER_FORWARD 0xA7
#define VK_BROWSER_REFRESH 0xA8
#define VK_BROWSER_STOP 0xA9
#define VK_BROWSER_SEARCH 0xAA
#define VK_BROWSER_FAVORITES 0xAB
#define VK_BROWSER_HOME 0xAC

#define VK_VOLUME_MUTE 0xAD
#define VK_VOLUME_DOWN 0xAE
#define VK_VOLUME_UP 0xAF
#define VK_MEDIA_NEXT_TRACK 0xB0
#define VK_MEDIA_PREV_TRACK 0xB1
#define VK_MEDIA_STOP 0xB2
#define VK_MEDIA_PLAY_PAUSE 0xB3
#define VK_LAUNCH_MAIL 0xB4
#define VK_LAUNCH_MEDIA_SELECT 0xB5
#define VK_LAUNCH_APP1 0xB6
#define VK_LAUNCH_APP2 0xB7

So, to answer your question "to intercept" them you could filter them while
processing WM_KEYDOWN which I think is what is done on 95 and 98. But you
may end up tripping over the keyboard manufacturer''s software (like
Intellimouse, say) if you do that.
Curiosity more than anything.



As Martha might say, curiosity is a good thing. <g> If you curiosity is not
yet sated, you might want to take a look here:

http://www.microsoft.com/whdc/device/input/w2kbd.mspx

Regards,
Will


> news:ud**************@TK2MSFTNGP15.phx.gbl...

Does anyone know if it''s possible (and if so, how) to intercept presses on ''multimedia keys'' you find on keyboards?
If the vendor is playing by the rules and if the o/s in question is ME,


2K, XP or 2K+3, the simple thing to do is to respond to the WM_APPCOMMAND
message. At that point the keyboard software has mapped the keystroke
message into an application command like "Play" for example.
In order, probably not, yep and OK.

The standard keys on the enhanced keyboards are defined in <winuser.h>:

So, to answer your question "to intercept" them you could filter them while processing WM_KEYDOWN which I think is what is done on 95 and 98. But you
may end up tripping over the keyboard manufacturer''s software (like
Intellimouse, say) if you do that.
They''d better not get in my way! :-) Their software falls over all the time
like a twig in a stiff breeze anyway...

Curiosity more than anything.
As Martha might say, curiosity is a good thing. <g> If you curiosity is


not yet sated, you might want to take a look here:

http://www.microsoft.com/whdc/device/input/w2kbd.mspx


Martha is, I''m afraid, lost to transatlantic language barrier or my total
lack of sleep :-) Thanks for the link - it looks... ''comprehensive'' :)

Thanks!

Steve


Watch out for the volume level changing keys, they are often abused (that''s
how I see at least) to control the master level when put on speakers. Many
of the users feel confused and start searching for your support email
address if your application happens to trap them to change its own private
sound level, as applications should for good behaviour.


这篇关于拦截'多媒体键'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆