473,662 Members | 2,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Keypress in Opera

Hi,
I'm having quite an annoying problem with Opera.
I have set up a keypress event handler which should react to any
alphabetic character.
In Opera however when I press F5 the event.keyCode=1 16. And when I press
"t" event.keyCode=1 16. How can I make the distinction between F5 and "t"?

Is there some reference for javascript objects in Opera somewhere?

Thanks!
Robert
Apr 19 '06 #1
2 2302
Robert wrote:
Hi,
I'm having quite an annoying problem with Opera.
I have set up a keypress event handler which should react to any
alphabetic character.
In Opera however when I press F5 the event.keyCode=1 16. And when I press
"t" event.keyCode=1 16. How can I make the distinction between F5 and "t"?

Is there some reference for javascript objects in Opera somewhere?


Yes - but I can't remember where to find it. Searching terms like "Opera
javascript keypress" should help.

I dealt with this awhile ago when I built a "breakout" type game
(incomplete - just a trial run) - feel free to take a look over the code
here: http://members.dslextreme.com/users/tony23/bricks.htm

I'm pretty sure you can find the answer in there.
Apr 19 '06 #2
Tony wrote:
Robert wrote:
Hi,
I'm having quite an annoying problem with Opera.
I have set up a keypress event handler which should react to any
alphabetic character.
In Opera however when I press F5 the event.keyCode=1 16. And when I
press "t" event.keyCode=1 16. How can I make the distinction between F5
and "t"?

Is there some reference for javascript objects in Opera somewhere?

Yes - but I can't remember where to find it. Searching terms like "Opera
javascript keypress" should help.


I searched before posting and didn't quite get what I was looking for.
I dealt with this awhile ago when I built a "breakout" type game
(incomplete - just a trial run) - feel free to take a look over the code
here: http://members.dslextreme.com/users/tony23/bricks.htm
Still fun to play :)
I had in mind to make tetris in javascript some time.
I'm pretty sure you can find the answer in there.


Didn't find what I was looking for. But I found out by myself that Opera
also supports the proprietary which property for keyboard events. And I
can make the distinction now.
Apr 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7365
by: Darryn Ross | last post by:
Hi, I am trying to catch the KeyPress event on my datagrid but it isn't working... i have also tried registering the handler with the event like this... dgGLBatch.KeyPress += new KeyPressEventHandler(dgGLBatch_KeyPress); but nothing changed. I was wondering wether a custom table and column style might have an effect on how this works???
3
8477
by: Raul M. Colon | last post by:
Is possible to assign a click event to a button control in a Web form just pressing the return key? Something like windows forms where you can assign this action to a default control. For example, if I press Return, I want to fire the button_click event even when the button is not in focus. Any thoughts? Thanks! Raul
2
5397
by: rege | last post by:
Hi, I have two applications developed in C# say A and B. When user presses key "L" with applicaition A active , it causes a keypress event which causes application B to run. Application A then waits for application B to exit. On exit from Application B the focus shifts back to application A. The problem is if user presses L more than once, say thrice, then three keypress events are generated. Therefore application A starts
1
6170
by: Rene | last post by:
Hi, I am running is some problems with the KeyPreview and KeyPress events. The KeyPress event is only triggered when there this an focusable control on the form. When all controls are disabled the Form.KeyPress event does not trigger anymore. A way to 'solve' this is to set the focus to the form, but during testing it happens ofter the keypress event is not getting triggered on keys like
4
4524
by: Tom | last post by:
I have a VB.NET user control that I wrote - this control has three or four other controls on it (textbox, combobox, datetime picker, etc). Now, whenever the control is on a form and the user enters anything into the textbox (for instance) I trap the keypress event to handle some stuff (i.e. if it is an enter key, etc). Now, once I am done with handling the keypress event for the textbox, I then need to pass that keypress event BACK to the...
15
4036
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE CALLING FORM! This is very bad for me, because in my application, Form1 responds to an ENTER keypress by calling Form2. If the user closes Form2 via an ENTER, then Form1 just reopens it again, kind of trapping the user in Form2 (they can still close...
3
6852
by: Fia | last post by:
Hi In Visual Basic 6 I could call keypress with an integer of a choosen key. For example I could call a textbox's keypress with the number 13 (for the enter key). But now in Visual Basic .Net I don't know how I shall do to do the same thing. I have tried to send Keys.Numpad8, but then it complains about it cannot convert from Keys to keyEventArgs I have also tried to send the number 8, but then it complains it cannot convert from Integer...
1
2038
by: mens libertina | last post by:
Hello, I am programming a little game, and I want the focus to move from one input box to the next as the user types. I have image-input pairs so the user is typing a letter under a picture. (Similar to word jumbles or cryptograms.) I'm also keeping track of the user's complete guess in a cookie so they can save their game. I get the input; if it's a letter, I capitalize it and update the cookie; then move the focus to the next input...
4
2791
by: Jeff | last post by:
....still new at this. ...hopefully a simple question Is there some practical way of altering the function of a keypress in Visual Web.net 2005 using VB without causing a postback on each keypress? For example: A have a listbox with a number of selections. The up and down keyboard keys change the indicated listbox selection and by default the <tabkey takes the focus away from the listbox and onto a button that will submit the selection. I'm...
0
8432
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.