469,271 Members | 1,322 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

How to Capture CTRL+SHIFT+P at Same Time??

I'm working on controlling a windows media player I'm trying to figure
out how to control it with keys like CTRL+SHIFT+P to play it. The
problem is that I don't know how to capture all three at the same time.

I'm ONLY supporting IE because that's what the client only want's
supported. I have been reading through the forums but nothing about
capturing both CTRL+another key or SHIFT+another key.

If you have any ideas that would completely be helpful.

Oct 27 '06 #1
4 3728
ASM
t3********@gmail.com a écrit :
I'm working on controlling a windows media player I'm trying to figure
out how to control it with keys like CTRL+SHIFT+P to play it.

<script type="text/javascript">
function detect(Event) {
if(Event==null) {
alert('null');
Event=event;
}

var msg = 'Key(s) pressed : ';

var cod = altk = ctrk = shft = false;

cod = Event.keyCode;
altk = Event.altKey;
ctrk = Event.ctrlKey;
shfk = Event.shiftKey;

if(cod) msg += cod;
if(shfk) msg += '\n+ Shit Key';
if(ctrk) msg += '\n+ Ctrl Key';
if(altk) msg += '\n+ Alt Key';

alert(msg);
}

</script>
</head>

<body onkeyup="detect(event)">
Oct 27 '06 #2
Sweet this is exactly what I was looking for!

Except one thing I noticed is that when I leave the page then go back
to the page that it won't detect the key events. Is there a reason why
it does this?

Oct 27 '06 #3
ASM
t3********@gmail.com a écrit :
Sweet this is exactly what I was looking for!

Except one thing I noticed is that when I leave the page then go back
to the page that it won't detect the key events. Is there a reason why
it does this?
I can't reproduce what you say.

- FireFox and Safari : OK
- IE Mac 5.2 affects a number to Alt, Ctrl and Shift ==2 alerts :-(
key code of pressed special touch then complete message
- Opera 9 is completely mad and thinks I type F4 when Ctrl+4 are typed
and better plays all kind of fantasies passing threw its mind ...
- iCab ignores any typed touch
Oct 27 '06 #4

ASM wrote:
t3********@gmail.com a écrit :
Sweet this is exactly what I was looking for!

Except one thing I noticed is that when I leave the page then go back
to the page that it won't detect the key events. Is there a reason why
it does this?

I can't reproduce what you say.

- FireFox and Safari : OK
- IE Mac 5.2 affects a number to Alt, Ctrl and Shift ==2 alerts :-(
key code of pressed special touch then complete message
- Opera 9 is completely mad and thinks I type F4 when Ctrl+4 are typed
and better plays all kind of fantasies passing threw its mind ...
- iCab ignores any typed touch

I'm using windows. I'll have to try the code on my home PC. I'll let
you know.

-Tony

Oct 27 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by orekinbck | last post: by
reply views Thread by Gene Hubert | last post: by
6 posts views Thread by SJ | last post: by
hsn
4 posts views Thread by hsn | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.