Hi again,

I found I can disable IE's backspace behaviour like this:

            document.>            function blockBackspace() {
                if (window.event && window.event.keyCode == 8) {
                    var t = event.srcElement.tagName;
                    t = t.toLowerCase();
                    if (t == "input") {
                        t = event.srcElement.getAttribute("type");
                        t = t.toLowerCase();
                    }
                   
                    if (t == "text" || t == "password" || t == "textarea") {
                        // allow backspace
                    }
                    else {
                        // block backspace
                        window.event.cancelBubble = true;
                        window.event.returnValue = false;
                        return false;
                    }
                }
            }       

But I wonder if I can do the same thing with Qooxdoo 0.5.x?

Simon


Simon Bull <[EMAIL PROTECTED]> wrote:
Hi Sebastian,

With your code (below) pressing the alpha-num keys causes alerts like "caught keystroke: 104".  Pressing backspace causes no alert but it does make the browser do a history.back(), which is what I want to disable.

I also notice that pressing F1 to F12, shift, ctrl, alt, insert, delete, home, end, page up/down causes no alert.

Simon


Sebastian Werner <[EMAIL PROTECTED]> wrote:
Please try the following:

d.addEventListener(QxConst.EVENT_TYPE_KEYPRESS, function(e) {
alert("caught keystroke: " + e.getKeyCode());
});

What is the alert message if you press backspace in IE?

Sebastian


Simon Bull schrieb:
> Hi All,
>
> I am using a modified version of Qx 0.5.x and am trying to disable IE's
> default "back" behaviour when the user presses the backspace key.
>
> I have tried this:
>
> var d = this.getClientWindow().getClientDocument();
> d.addEventListener(QxConst.EVENT_TYPE_KEYPRESS, function(e) {
> alert("caught keystroke");
> if ( e.getKeyCode() == QxKeyEvent.keys.backspace ) {
> alert("caught backspace");
> return;
> };
> });
>
> which catches key presses like "z" and "9" - but doesn't seem to catch
> the backspace key.
>
> Does anyone know how to intercept the backspace keypress?
>
> Thanks,
>
> Simon
>
>
> ------------------------------------------------------------------------
> On Yahoo!7
> 360°: Share your blog, photos, interests and what matters most to you
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


On Yahoo!7
Messenger: Make free PC-to-PC calls to your friends overseas. -------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Do you Yahoo!?
Take part in Total Girl’s Ultimate Slumber Party and help break a world record
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to