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

T

t3projects

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.
 
A

ASM

(e-mail address removed) 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)">
 
T

t3projects

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?
 
A

ASM

(e-mail address removed) 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
 
T

Tony

ASM said:
(e-mail address removed) a écrit :

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top