Javascript onkeypress conundrum

  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

well I was wondering if there was a way of testing to see if the ctrl key is pressed.

As it has no character ascociated with it, it does not seem to trigger any events. Any one got any ideas? :?



//edit, this thread is a complete lie. I want the ctrl key to trigger the onkeydown and onkeyup events. The principle is the same though and I still can't get it to work so any suggestions appreciated :P
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Key.getCode() returns 17 for CTRL in flash, Maybe javascript has somthing similar ?
  • stevegmag
  • Novice
  • Novice
  • User avatar
  • Posts: 29
  • Loc: Washington DC

Post 3+ Months Ago

this should hook you up...

http://www.webdevelopersjournal.com/art ... ents3.html

I think it only works in conjunction with other key/mouse events, but I could be wrong.
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Looks as though I was coming at this from the wrong direction. thank you stevegmag, they do seem to have what I am looking for, which is the clicking with mouse and ctrl pressed down.

Sadly their code does not work in anything but IE, I found it quite amusing to see the link for "How did they do that? Find out in amazing html" where the html for that area of the site was totally screwwed up in firefox :lol:

I guess I will just have to go write a decent version of their javascript.....

Thanks again guys
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Well, the code they use is microsoft only, which sucks under the best of conditions, but sucks even harder when you are only trying to target mozilla.

I consulted the big book of javascript knowledge which pointed me in the direction of window.Event.modifiers but I'm damned if I can get that to work.

Tried googling and found this site:
http://www.javascripter.net/faq/ctrl_alt.htm

which claims to do a cross browser kinda thing, but again, I'm damned if I can get it to work.

Oh well it wasn't really that important anyway.

//BTW I would advise anyone and everyone to boycott the site stevegmag posted. All of their code is IE-only stuff. They have nothing cross-browser at all.
  • stevegmag
  • Novice
  • Novice
  • User avatar
  • Posts: 29
  • Loc: Washington DC

Post 3+ Months Ago

how do you get upgraded from newwbie, etc... up the chain? is it all based on number of posts? or quality of post?
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

quantity, not quality, and it goes a little something like this:

unflux wrote:
0 Newbie's Assistant
5 Newbie
15 Novice
35 Beginner
65 Student
100 Graduate
250 Expert
500 Teacher
750 Professor
1000 Guru
1500 Master Guru
2500 Hacker
3000 Master Hacker


But spamming won't get you anywhere :lol:

TBH most people don't really pay much attention to them - i think it's just a bit of fun mostly

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 111 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.