Can i configure FireFox browser to act like IE when key is pressed?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JeanLuc
    New Member
    • Sep 2010
    • 5

    #1

    Can i configure FireFox browser to act like IE when key is pressed?

    Hi, is there any way i can configure firefox so that when i press the ENTER key i can catch through javascript the event.keyCode== 13? Perhaps identifying the browser agent and then make some configurations? It would be a dream come true.
    Thanks even for reading this.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You can.
    In FireFox event.keyCode doesn't exist though, you should use e.charCode instead.

    This code works in all browsers:
    Code:
    function ASCIIKeyPressValue(e) {
        var keynum;
        if (e.charCode != null) {
            keynum = e.charCode;
        } else if (e.keyCode != null) {
            keynum = e.keyCode;
        } else if (e.which != null) {
            keynum = e.which;
        }
        return keynum;
    }
    -Frinny

    Comment

    Working...