Closed Bug 191190 Opened 22 years ago Closed 2 years ago

In Midas, support keyboard accelerators for formatting text

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1500682

People

(Reporter: aaronlev, Unassigned)

References

Details

(Keywords: access, helpwanted, Whiteboard: midas)

When Midas has focus, the meaning of some keys should based on the editing context:

Accel+B Bold
Accel+I Italic
Accel+U Underline
Accel+minus smaller
Accel+plus larger
Accel+[ or ]  -- decrease/increase indent
Accel+K -- spell check

We also may want to support some of our other keys, like paste as quotation
(accel+shift+v).

I wouldn't change the meaning of Accel+T to be fixed with. New tab is too
important. I would not implement Accel+L, but that's a tough call. Link/location
bar are both important.

This is similar to using Yahoo mail compose with IE -- these keystrokes work
there even though the menu items are not present.

Note, Accel+letter keys do not change based on i18n.
Just one note: with the spanish keyboard isn't possible (usually) to use the
Accel+[ or ] combos. the [ and ] need the use of the AltGr key and the ] is in
the same key that +

Of course it's better to have some shortcuts working that not having none :-),
so anything will be welcome.
Status: NEW → ASSIGNED
Keywords: nsbeta1
Whiteboard: midas
Why would we add these in rather than having the creator of the application do this?

It is only Accel+B on US keyboards, so this would be yet another translation hit.

If we did do this, we should probably just separate the composer accelerators
that already exist into another file and use them.
Mike, that's not true. It's Accel+B on all keyboards.

Accesskeys change from language impl to language impl. Global keyboard
accelerators do not.
Filed bug 192330, "keyboard shortcut (Ctrl+Shift+V) for 'paste without formatting'."
QA Contact: sujay → sairuh
adt: nsbeta1-
Keywords: nsbeta1nsbeta1-
Samir, I think it's a mistake to minus this.
Keyboard accelerators are not a marginal feature of an editor.

Open http://www.mozilla.org/editor/midasdemo/
and you'll see that keyboard accelerators work. For example, Ctrl+B makes text
bold while focused in the editor. If you click outside, Ctrl+B does bookmarks.
This is just how I would expect it to work.
I meant, open the demo in Internet Explorer, and you'll see the keyboard 
accelerators work. :-)
Here's where we determine what key bindings to use:
http://lxr.mozilla.org/seamonkey/source/content/xbl/src/nsXBLWindowHandler.cpp#219

We use a terrible hack:
if (presShell) {
248     PRInt16 isEditor;
249     presShell->GetSelectionFlags(&isEditor);
250     return isEditor == nsISelectionDisplay::DISPLAY_ALL;
251   }

It's considered an editor if selection can be displayed on anything.
It's quite easy to make Midas support keyboard accelerators. I took the code at 
http://www.mozilla.org/editor/midasdemo/ and patched it to support B,I and U
accelerators.

You can try out the result here 
http://masendav.com/~duke/midas/

If you want to know how it's done, look for the kb_handler function in the source.
QA Contact: bugzilla → editor

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: brade → nobody
Status: ASSIGNED → NEW
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.