Insert character shortcut

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
MatijaOgrin
Posts: 6
Joined: Wed Oct 09, 2013 11:18 pm

Insert character shortcut

Post by MatijaOgrin » Thu Oct 10, 2013 12:38 am

Hello,
would you please advise me how to make a keyboard shortcut to insert some special character when transcribing an old text (instead of clicking "Edit" and "Insert from Character map" and then searching for the right character again and again).
Thanks,
Matija

Costin
Posts: 711
Joined: Mon Dec 05, 2011 6:04 pm

Re: Insert character shortcut

Post by Costin » Thu Oct 10, 2013 9:41 pm

Hello,

Please note that starting from version 15.0, a toolbar action dedicated to inserting special characters is available in oXygen.

In order to enable the Symbols toolbar, you should go into the oXygen menu Window > Configure Toolbars and just check the box near "Symbols".
An action with an "Omega" like icon would appear on your toolbar, allowing you to insert recently used special characters, making the editing process easier and less time consuming.
The toolbar also allows you to open the Character Map dialog for more symbols.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

MatijaOgrin
Posts: 6
Joined: Wed Oct 09, 2013 11:18 pm

Re: Insert character shortcut

Post by MatijaOgrin » Fri Oct 11, 2013 12:10 am

Thanks, Costin!
I know about the 'Symbols' toolbar, I used it -- but it is too much time consuming if you have several special characters in your text.
What I am looking for is a real keyboard shortcut. I hope this can be done at least by means of some plugin or macro. Am I right?
Best,
Matija

MatijaOgrin
Posts: 6
Joined: Wed Oct 09, 2013 11:18 pm

Re: Insert character shortcut

Post by MatijaOgrin » Fri Oct 11, 2013 9:49 am

MatijaOgrin wrote: I know about the 'Symbols' toolbar, I used it -- but it is too much time consuming if you have several special characters in your text.
Let me explain again: the 'Symbols' toolbar is nice, if you have some characters to insert, but if you have hundreds or thousands of, e.g., "Latin small long letter s" (ſ) to insert, then you need, as I said,
MatijaOgrin wrote: a real keyboard shortcut. I hope this can be done at least by means of some plugin or macro.
Regards,
Matija

adrian
Posts: 2674
Joined: Tue May 17, 2005 4:01 pm

Re: Insert character shortcut

Post by adrian » Fri Oct 11, 2013 2:35 pm

Hi,

Unfortunately you cannot set a shortcut to directly insert/reinsert a character either from the Symbols popup or from the Insert from Character map dialog. We have a request logged on our issue tracking tool for this. I've added your vote.

Some alternatives, though only practical if you use a fixed and limited number of special characters, are:
- to create an Author action for each of the characters. This is document type specific (DITA, DocBook, etc) and works only for Author mode: Options > Preferences, Document Type Association, select the document type and press Edit (Duplicate if prompted to). Then in the Author tab, Actions section you can define the actions (with shortcuts) and add them to at least one menu (Menu or Contextual menu) or Toolbar. When defining the actions, you can use the InsertFragmentOperation and specify the special character as the fragment.

- to define code templates (Options > Preferences, Editor > Templates > Code Templates) for each special character. Note that these don't have shortcuts either, but are easily accessible by pressing Ctrl+Space (shows the list of available code templates).

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

MatijaOgrin
Posts: 6
Joined: Wed Oct 09, 2013 11:18 pm

Re: Insert character shortcut

Post by MatijaOgrin » Sat Oct 12, 2013 11:27 am

adrian wrote: ... to define code templates (Options > Preferences, Editor > Templates > Code Templates) for each special character. Note that these don't have shortcuts either, but are easily accessible by pressing Ctrl+Space (shows the list of available code templates).
Thank you, Adrian, -- this is a nice solution to my problem! Many thanks,
Matija

Radu
Posts: 7148
Joined: Fri Jul 09, 2004 5:18 pm

Re: Insert character shortcut

Post by Radu » Tue May 19, 2015 1:50 pm

Hi,

Just to update this thread, in Oxygen 17 you can configure a code template and set a keyboard shortcut for it. So you can configure a code template which inserts a certain character.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Adversary
Posts: 2
Joined: Wed Jul 22, 2015 1:03 am
Contact:

Re: Insert character shortcut

Post by Adversary » Wed Jul 22, 2015 1:53 am

Radu wrote:Hi,

Just to update this thread, in Oxygen 17 you can configure a code template and set a keyboard shortcut for it. So you can configure a code template which inserts a certain character.
As of about five minutes ago I finally managed to get my work around for this problem to behave itself. It's ideal for those people who may need to add lots of different characters rather than just a few favourites or where any such additions might change from one project to the next.

The principal requirement is a text editor with support for performing the character insertion. In my case that editor is GNU Emacs (compiled locally with the nextstep flag to build the app, not Aquamacs or any other prebuilt version) and it's running on OS X. To set it up, go into the External Tools preferences as shown here.

For the name, put in the name of your editor, description is whatever you like really (if you have a few editors or config options maybe note that here), for working directory use the tag denoting the directory the file is in and for the command line put the full path to the editor followed by the working directory tag, a forward slash (probably a double backslash on windows) and then the tag for the file with extension. So mine looks like this:

Code: Select all


             Name:  Emacs
Description: Open file with new Emacs instance
Working directory: ${cfd}
Command line: /Applications/Emacs.app/Contents/MacOS/Emacs ${cfd}/${cfne}
Then I just bound it to Control+X, which is the same binding I use with the It's All Text add-on for Firefox and off I go. It definitely works with stand alone files (e.g. a DocBook XML file), but can't open a file inside a container file because it can't treat the zip file as a directory as while in the process of attempting to access the actual target file.

There's probably a way around this with shell scripting, but it could very easily get so fiddly theat things broke permanently and so better to make all the necessary edits before converting to a format like that. Also, though the behviour is likely tovary a little according to operating system, try to avoid spaces in either the path to the target or the filename of the target.

Aside from those two points, it works fine and even loading a fresh Emacs instance from scratch is a lot quicker than waiting for Java to index every font on the system every time you go to search something. Vim and Vi users may need to do some additional scripting to load their editor in a terminal if not using the GUI wrapped version.

Additional documentation can be found here.

So, having now succeeded with this, I no longer feel the urge to drive one of these, †, deep into the heart of the JVM.

Post Reply