Closed Bug 310989 Opened 19 years ago Closed 18 years ago

Use user-set autocomplete keybinding in location bar

Categories

(Camino Graveyard :: Location Bar & Autocomplete, enhancement)

PowerPC
macOS
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: englabenny, Assigned: mikepinkerton)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20051001 Camino/1.0+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20051001 Camino/1.0+

It is possible to configure the Mac OS X text editing keybindings in a quite
advanced way.

The location bar should live up to OS X standards and answer to the user-defined
keybindings.


Reproducible: Always

Steps to Reproduce:
To set an autocomplete keybinding use this:
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
    "\033"="complete:"; /* Use escape for completion */ 
}
Actual Results:  
In the location bar, sadly escape cancels input and reverts the location to the
current location

Expected Results:  
Camino should answer to the complete: message by triggering completion (now
hard-bound to tab)

This really works in common text fields, all over the system. Bind complete: to
escape, and you can choose File -> Open (for example in Camino), press
shift-cmd-G to get an 'Open Folder' dialogue. Then you can type for example
"~/Lib", press esc, and it autocompletes.
This one is hard to fix. We are overriding the esc key in BrowserWindow.mm in
BrowserWindow's sendEvent: method. Without this override, the autocompletion
works just like any other text field. But I can't find where to catch the
complete: action to override it. If we have to do some silly fieldEditor
override hack then it's not worth it.
...I found out that it's not hard to fix. I can produce a working patch very
easily, but with some caveats.

I decided (this is only me, leave feedback) that it's useless to not block
escape, because if we don't use escape to "escape" the location bar, we can't
get out of it with the keyboard easily.
So the fix I suggest is: make the autocomplete field respond to the standard
complete: method (easy), but continue to pick up escape higher up so that
particular key doesn't work.
This patch makes AutoCompleteTextField respond to the standard -
(void)complete:(id)sender message (NSResponder), that is send when the user
presses his/her autocomplete key (default F5).

The patch makes complete: do the same thing insertTab: does when the
suggestions pane is open: jump to the next matching completion.

Escape is a key that is picked up higher up by the Window Controller, and this
is a sensible thing to do. Therefore, this patch does not alter that, and thus
not any user-set key will work as a autocomplete key.
Attachment #198481 - Flags: review?(sfraser_bugs)
Confirming... CCing Simon.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 198481 [details] [diff] [review]
Patch to make the AutoCompleteTextField respond to complete:

Works as advertized; r=me.  I'm not wild about the code duplication, but I'm not sure that rearranging the conditionals would be much better; I'll leave that to the discretion of whoever sr's.
Attachment #198481 - Flags: superreview?
Attachment #198481 - Flags: review?(sfraser_bugs)
Attachment #198481 - Flags: review+
Comment on attachment 198481 [details] [diff] [review]
Patch to make the AutoCompleteTextField respond to complete:

sr=pink
Attachment #198481 - Flags: superreview? → superreview+
Whiteboard: [needs checkin]
Checked in on trunk and branch yesterday.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Keywords: fixed1.8.1
Whiteboard: [needs checkin]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: