Closed Bug 478651 Opened 15 years ago Closed 15 years ago

No key repetition for movement or deletion

Categories

(Skywriter Graveyard :: Editor, defect, P1)

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: boushley, Assigned: dion)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6
Build Identifier: http://hg.mozilla.org/labs/bespin/

If any of the arrow keys or the backspace, delete keys are held down they only work once.  There is no repetition.  Holding down letters to input text works, but not arrow keys or backspace.

Reproducible: Always

Steps to Reproduce:
1.Enter text to delete or navigate around
2.Hold down keys to move around or delete, only does one character per press.
Actual Results:  
Only one character is deleted no matter how long key is held.

Expected Results:  
Key repetition while the key is held.
In Bespin.Editor.DefaultEditorKeyListener.onkeydown in editor/editor.js:

        // If a special key is pressed OR if an action is assigned to a given key (e.g. TAB or BACKSPACE)
        if (e.metaKey || e.ctrlKey || e.altKey || hasAction) {
            this.skipKeypress = true;
            this.returnValue = true;
            if (hasAction || !Bespin.Key.passThroughToBrowser(e)) Event.stop(e); // stop going, but allow special strokes to get to the browser
        }

this.skipKeypress = true stops the key repeat (which is sent as a key press) because of this code in the next function, onkeypress:

        if (this.skipKeypress) {
            if (!Bespin.Key.passThroughToBrowser(e)) Event.stop(e);
            return this.returnValue;
        }

On the Mac at least, in a native app holding down a control combination (e.g. apple-C) repeats the command, so I think even special keys should be allowed repeat. I get that behaviour if I comment out the relevant line in onkeydown.
Same here on a Mac. Platform -> All
OS: Linux → All
Dany,

Thanks for the patch. I had actually just put in a change that allows anything BUT special key combos to repeat (so we don't need the "allow" array).

Still need to fix it fully to allow special characters. The problem there is that keydown gets charCode and we have keyCode checks, so we need to duplicate that, so if in keypress it uses charCode and in keydown it uses keyCode.
Assignee: nobody → dion
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Priority: -- → P1
Resolution: --- → FIXED
Whiteboard: keybindings
Target Milestone: -- → 0.2
Version: unspecified → Trunk
This is a mass migration from Mozilla Labs :: Bespin to Bespin :: Key Bindings.
Component: Bespin → Key Bindings
Product: Mozilla Labs → Bespin
QA Contact: bespin → key.bindings
Whiteboard: keybindings
Target Milestone: 0.2 → 0.2.x
Indeed, this was fixed in changeset 1c2e1d714cb6.

In addition to being a duplicate of bug 478690, I'm marking this as dependent on bug 475374 and moving it to the Editor component. Also, this was fixed in time for the 0.1.3 release.
Severity: normal → major
Status: RESOLVED → VERIFIED
Component: Key Bindings → Editor
Depends on: 475374
QA Contact: key.bindings → editor
Hardware: x86 → All
Target Milestone: 0.2.x → 0.1.3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: