How do I disable single-key key bindings in Eclipse Text widgets -


i developing eclipse rcp application , have defined custom context (org.eclipse.ui.contexts) editors. context activated whenever invoke 1 of editors.

further, have defined single-key key binding (org.eclipse.ui.bindings) have scoped context which, when typed within editor context, invokes command/handler (i'll use letter 'j' example).

everything works expected. when launch/select 1 of custom editors, context activated , 'j' executes handler. when launch/select view part, custom editor's context deactivated , 'j' no longer executes handler. however, when click in text widget somewhere in window trim area--let's quick access field--and type letter 'j', keystroke consumed , executes handler, behavior not want.

the reason selecting workbench part has effect of activating context , deactivating previous one. clicking anywhere else in workbench window area (other part) not deactivate previous context. sure design , reasonable approach. however, prevents me defining single-key key bindings.

has a) run problem before , b) if so, how did solve it?

for using complete hack involves using global listener disable key binding service entirely on detecting entry text widget, , re-enabling on exit text widget.

in extension point point <extension point="org.eclipse.ui.bindings"> not specify command id replace existing key.

see documentation details.

commandid - unique identifier of command key sequence specified key binding assigned. if value of attribute empty string, key sequence assigned internal 'no operation' command. useful 'undefining' key bindings in specific key configurations , contexts may have been borrowed parents.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -