Rebinding actions related to the in-file search dialog doesn't work #60

Open
cawoodm opened this Issue Dec 14, 2012 · 6 comments

Comments

Projects
None yet
3 participants
@cawoodm

cawoodm commented Dec 14, 2012

No description provided.

@aeisenberg

This comment has been minimized.

Show comment
Hide comment
@aeisenberg

aeisenberg Dec 14, 2012

Contributor

Unfortunately, these lower end Fn keys cannot be rebound. We cannot override some of these browser and system keybindings.

Contributor

aeisenberg commented Dec 14, 2012

Unfortunately, these lower end Fn keys cannot be rebound. We cannot override some of these browser and system keybindings.

@cawoodm

This comment has been minimized.

Show comment
Hide comment
@cawoodm

cawoodm Dec 14, 2012

Well Ctrl+L is a Chrome hotkey which can be overridden by scripted so I tried this out:

document.onkeydown = function(event){
    event.preventDefault();
    console.log('Key: '+event.keyCode);
    if (event.keyCode == 114) console.log("You pressed F3 and Chrome doesn't know!");
    return false; 
}

and it seeems to work: Chrome doesn't open it's Find dialog when you press F3. Works in FF too.

cawoodm commented Dec 14, 2012

Well Ctrl+L is a Chrome hotkey which can be overridden by scripted so I tried this out:

document.onkeydown = function(event){
    event.preventDefault();
    console.log('Key: '+event.keyCode);
    if (event.keyCode == 114) console.log("You pressed F3 and Chrome doesn't know!");
    return false; 
}

and it seeems to work: Chrome doesn't open it's Find dialog when you press F3. Works in FF too.

@aeisenberg

This comment has been minimized.

Show comment
Hide comment
@aeisenberg

aeisenberg Dec 14, 2012

Contributor

Thanks for the test case. We'll take a look and see how we can get these
kinds of keys overridable in scripted. Seems to work on mac-chrome, too.

On Fri, Dec 14, 2012 at 10:01 AM, cawoodm notifications@github.com wrote:

Well Ctrl+L is a Chrome hotkey which can be overridden by scripted so I
tried this out:

document.onkeydown = function(event){
event.preventDefault();
console.log('Key: '+event.keyCode);
if (event.keyCode == 114) console.log("You pressed F3 and Chrome doesn't know!");
return false; }

and it seeems to work: Chrome doesn't open it's Find dialog when you press
F3. Works in FF too.


Reply to this email directly or view it on GitHubhttps://github.com/scripted-editor/scripted/issues/60#issuecomment-11385746.

Contributor

aeisenberg commented Dec 14, 2012

Thanks for the test case. We'll take a look and see how we can get these
kinds of keys overridable in scripted. Seems to work on mac-chrome, too.

On Fri, Dec 14, 2012 at 10:01 AM, cawoodm notifications@github.com wrote:

Well Ctrl+L is a Chrome hotkey which can be overridden by scripted so I
tried this out:

document.onkeydown = function(event){
event.preventDefault();
console.log('Key: '+event.keyCode);
if (event.keyCode == 114) console.log("You pressed F3 and Chrome doesn't know!");
return false; }

and it seeems to work: Chrome doesn't open it's Find dialog when you press
F3. Works in FF too.


Reply to this email directly or view it on GitHubhttps://github.com/scripted-editor/scripted/issues/60#issuecomment-11385746.

@kdvolder

This comment has been minimized.

Show comment
Hide comment
@kdvolder

kdvolder Dec 14, 2012

Member

To correct Andrew's info: there's actually really no problem rebinding F3 key in general, I think. Just tried it out and bound 'insert newline at end of line' action to F3. Not a problem.

What I think may be the problem is the 'Find next occurence' isn't really an action like most others in that it has to be executed in the context of a search. So it isn't handled by the orion keybinding/handling code in the same way. I think these actions/keybindings are hard-coded in the search dialog code that pops out at the top of the window.

Since they are are hard-coded, rebinding the keys doesn't work.

That's my current theory at least. I'll have to take a deeper look.

Kris

Member

kdvolder commented Dec 14, 2012

To correct Andrew's info: there's actually really no problem rebinding F3 key in general, I think. Just tried it out and bound 'insert newline at end of line' action to F3. Not a problem.

What I think may be the problem is the 'Find next occurence' isn't really an action like most others in that it has to be executed in the context of a search. So it isn't handled by the orion keybinding/handling code in the same way. I think these actions/keybindings are hard-coded in the search dialog code that pops out at the top of the window.

Since they are are hard-coded, rebinding the keys doesn't work.

That's my current theory at least. I'll have to take a deeper look.

Kris

@ghost ghost assigned kdvolder Dec 14, 2012

@cawoodm

This comment has been minimized.

Show comment
Hide comment
@cawoodm

cawoodm Dec 15, 2012

Often times one searches for something, does an edit then presses the "Find Next" hotkey to continue searching. This doesn't work with the standard binding Ctrl+K either which only seems to work inside the search dialog. Strangely F3 doesn't even work inside the search dialog so there is a) a need to support this binding in the editor and b) some inconsistent behaviour.

cawoodm commented Dec 15, 2012

Often times one searches for something, does an edit then presses the "Find Next" hotkey to continue searching. This doesn't work with the standard binding Ctrl+K either which only seems to work inside the search dialog. Strangely F3 doesn't even work inside the search dialog so there is a) a need to support this binding in the editor and b) some inconsistent behaviour.

@kdvolder

This comment has been minimized.

Show comment
Hide comment
@kdvolder

kdvolder Dec 17, 2012

Member

What you are telling me seems to confirm my theory. I know there is some special handling code for CTRL+K and CTRL+R keys in the 'search dialog'. This code is a bit naughty and hard-codes the keys so I already suspected it won't play nice with key-rebinding support.

Member

kdvolder commented Dec 17, 2012

What you are telling me seems to confirm my theory. I know there is some special handling code for CTRL+K and CTRL+R keys in the 'search dialog'. This code is a bit naughty and hard-codes the keys so I already suspected it won't play nice with key-rebinding support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment