473,398 Members | 2,525 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,398 software developers and data experts.

Firefox Key Press Problem

Hi

I have the following code in my site, however it is currently not working in firefox could someone please tell me why, thanks in advance

Expand|Select|Wrap|Line Numbers
  1. function buttonpress(button) {
  2. var key = new Array(); 
  3. key['-'] = "javascript:AddItem()";
  4. isNetscape=(document.layers);
  5. eventChooser = (isNetscape) ? button.which : event.keyCode;
  6. which = String.fromCharCode(eventChooser).toLowerCase();
  7. for (var i in key) if (which == i) window.location = key[i];
  8. }
  9. document.onkeypress = buttonpress;
  10.  
Mar 21 '08 #1
2 1411
mrhoo
428 256MB
Hard to say what you are trying to do,
but this will log the lower cased keystrokes to an array

Expand|Select|Wrap|Line Numbers
  1. function getKeypress(e){
  2.     e= window.event || e;
  3.     var k= e.charCode || e.keyCode;
  4.     var which= String.fromCharCode(k).toLowerCase();
  5.     keyLog.push(which);
  6. }
  7. window.keyLog=[];
  8.  
  9. document.onkeypress= getKeypress;
  10. //test
  11. document.ondblclick=function(){alert(keyLog)};
Mar 22 '08 #2
this peice of code is the key that is used to add a note on the site when pressed

Expand|Select|Wrap|Line Numbers
  1. key['-'] = "javascript:AddItem()";
Mar 30 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: VK | last post by:
<http://www.mozilla.org/>
3
by: Jim | last post by:
I had Firefox set as my default browser, but I wanted to change back to IE when testing my webservices. Easy enough....(in IE) Tools>Internet Options>Programs then check "Internet Explorer...
0
by: Joel Barsotti | last post by:
Hi, So with my search control I want people to be able to enter some text and press enter and have the search submit. I was doing this with javascript using the onKeyPress event for the...
10
by: Paul Gorodyansky | last post by:
Hi, Ran into the problem today - in INPUT field Firefox executes clean-yp of the content if a user presses Esc, _before_ control goes to the code via onkeydown - and search showed that it's a...
3
by: aryayudhi | last post by:
I have a html page that has javascript that works perfectly in IE, but not in Firefox. The use of this javascript to change "Tab" to "Enter" Button. When we press Tab, it is like when we press Enter...
2
by: veronicab | last post by:
Hi, I have a small JavaScript code in a page to trap when user presses Return key. My problem is that if you visit the page and then enter a different url in address field, and press Return,...
2
by: ra88it | last post by:
I'm working on some javascript games, and I encountered what appears to be a bug specific to Firefox on Linux (I'm using several recent versions of Ubuntu). I'd love to get some help verifying...
5
by: david | last post by:
I have a picture and it has onclick event, with invokes JavaScript function called ModuleManager(); Then it saves a copy of Node (Blocks, which is DIV) it tmp_blocks with all children elements. And...
5
by: hannie | last post by:
onKeyPress does not work in Firefox. If use tab to navigate each field and press "Enter" on "Next" button to submit form and process to the next form / page, IE works well even if without onKeyPress...
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.