Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] CodeEdit - listen to CTRL+DOWN-ARROW

Hi Libing,
I tried this code, but it did not trigger when CTRL+ARROW-DOWN is typed. Could you please try and let me know if there is anything else need to be set for it to work.

Also, I found the below doc-ref from orionhub for the list of action-ids.  

Assuming they are same for codeEdit, it may save you some effort to put that together.


Thanks

Gowrishankar Holalkere | Sr. Development Manager, IT
Solutions Development - Variable Data Management
Retail Branding and Information Solutions | Avery Dennison 
1700 West Park Drive, Suite 400, Westborough, MA 01581
508-948-3466 (office) | 508-308-7987 (mobile) 
Gowrishankar.Holalkere@xxxxxxxxxxxxxxxxx 


On Fri, Dec 4, 2015 at 12:10 PM, Libing Wang <Libing_Wang@xxxxxxxxxx> wrote:
Generally speaking, you can always register a orion.edit.command service(https://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Plugging_into_the_editor#orion.edit.command) with a keybinding to achieve your custom command, as I mentioned in the https://wiki.eclipse.org/Orion/How_Tos/Code_Edit#The_codeEdit.serviceRegistry_instance.

There are exceptions, editorViewer.editor.getTextView() instance, which is the core part of the widget, already preserved a lot of "common sense" key bindings for actions like editor navigations, etc. And ctrl+down-arrow & ctrl+up-arrow are two of them.
But do not worry, you can still use some low level APIs to override these actions. Please refer to the following snippet.

editorViewer.editor.getTextView().setAction("scrollLineDown", function(){// use "scrollLineUp" for ctrl+up-arrow.
    console.log("my action invoked!");
    return true;
});

Note that "return true" means you do not want the default behavior at all, while "return false" means you want both.

There are a lot of other preserved key bindings. I have not yet documented it but will soon. I am working on an html snippet so that you can run it to render a page listing up  all the preserved actions with action id and associated key bindings. Then from that list, the end users will have to decide if the desired key binding collides with the preserved one. They have to grab the action id(e.g. "scrollLineUp") and use the setAction API to override it.

Stay tuned on this incoming wiki section.

Libing



From:        Gowrishankar Holalkere <gowrishankar.holalkere@xxxxxxxxxxxxxxxxx>
To:        Orion developer discussions <orion-dev@xxxxxxxxxxx>
Date:        12/03/2015 10:59 PM
Subject:        [orion-dev]  CodeEdit - listen to CTRL+DOWN-ARROW
Sent by:        orion-dev-bounces@xxxxxxxxxxx




Hello,
Could you please tell me how to listen to CTRL+DOWN-ARROW and CTRL+UP-ARROW?

Thanks

Gowrishankar Holalkere| Sr. Development Manager, IT
Solutions Development - Variable Data Management
Retail Branding and Information Solutions | Avery Dennison 
1700 West Park Drive, Suite 400, Westborough, MA 01581
508-948-3466 (office) | 508-308-7987 (mobile) 
Gowrishankar.Holalkere@xxxxxxxxxxxxxxxxx 



-------------------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
-------------------------------------------------------------------------------------------------------------
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/orion-dev


_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/orion-dev



-------------------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
-------------------------------------------------------------------------------------------------------------


Back to the top