473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3927
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Mullins | last post by:
I've seen a bunch of people post that they had troubles with this, but never saw anyone post a working solution. Shift F2 = F12 Ctrl Shift F2 = Ctrl - This seems to work well, as it jumps...
5
by: Alex Stevens | last post by:
Hi All, I'm writing a launcher program which checks for updates and copies them down to the client. However, I would like the user to be able to modify the settings for the launcher. As this...
2
by: orekinbck | last post by:
Hi There In a C# windows app in .NET 2003, I would like to capture when the user is within a certain text box and holds down shift then presses tab. Atm, my code is: protected override bool...
0
by: Gene Hubert | last post by:
I've got this working but I've got to wonder if there's not a better way. I'm capturing the tab and shift-tab keys in a datagrid and doing custom processing. Also, the form designer gets...
1
by: Bill Johnson | last post by:
In vb6 I could quickly go to any given property while in the properties window by holding the CTRL + SHIFT keys down plus the first letter of the property I want to edit. For example, if I wanted...
6
by: SJ | last post by:
howdy, In vb6 I could say If Time >#4:00:00 PM# And Time < #4:01:00 PM# Then 'Do Something End If Well, I don't see the Time function in vb.net. I have experimented with the TimeSpan...
7
by: yonatnl | last post by:
why In every time I pressing Ctrl + Shift + B, Visual Studio Compiles The solution? I Did not changed a thing in the Code. It was Ok 2 days a Go... and After getting Latest Version from the...
0
by: Yusuf Incekara | last post by:
I 've assigned a shortcut key for CTRL+SHIFT+1 key in my application. I can handle these keys in Form's keydown event. private void Form1_Load(object sender, EventArgs e) { this.KeyPreview =...
4
hsn
by: hsn | last post by:
hello everyone. i want to add to a string the windows ctrl button and the shift button. what i mean is, i want to store a string which has, lets say "cmd", i want to add to this string ctrl and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.