# Shortcuts made using translation tables interfere with active strings

[WinEdt 8.2 in a 64-bit Windows 8.1 computer]

I don't know if "shortcut" is the proper English word to describe what I'm trying to get, and maybe that's why I wasn't able to find any info about it in the internet.

The aim of this question is to find a way to get a "\" by typing º, or to get a "}" by pressing "ç" [without pressing Alt or Shift] in order to improve typing and make ir more efficient.

I have found this can be done by adding entries to "KEYBOARD" list in Translation Tables, but this solution interferes someway with the Active Strings features, making that things like typing

    \begin{environment}}


do not get anymore

    \begin{environment}
*
\end{environment}".


I guess this happens because the "Active Strings" searches for some key combination that is no longer produced because of this "shortcut". As if the Translation Tables and the Active Strings worked in different depth levels, so they can not be combined.

To sum up, the problem would be solved by either finding a way to end up with this interference or finding another way to get this shortcut.

EDIT: I just found an interesting fact: Let's assume by default I have to press "AltGr+ç" to get a "}". If I set by a translation table the change '"ç"--->"}"', when I press "ç" key nothing happens, but it does with the original key combination "AltGr+ç".

• It finally started to work properly when I re-installed the WinEdt 9th version again. I fear I don't know where the problem was. However thank you both karlkoeller and @bernard , both solutions were in the end right. Mar 13 '15 at 15:43

This works.

Replace your TABLE="Keyboard" with this one in your local copy of TranslationTables.ini:

TABLE="Keyboard"
// Not used!
TYPE=4
INVERTED=0
ENABLED=1
MODE_FILTER=""
SUB="END_LIST"
#186 -> "\"
#231 -> "}"
END_LIST
END="Keyboard"


Then press Shift+Ctrl+F9 to reload the file.

• As I said in the question, "I have found this can be done by adding entries to "KEYBOARD" list in Translation Tables, but this solution interferes someway with the Active Strings features". The second translation (from #231 to "}" ), does not let the 'Activate Strings' process accurately my typing. Mar 12 '15 at 14:46
• @Sergio I'm involved in WinEdt development since many years and I can assure that it works, unless you've changed something else in your settings. Did you? Mar 12 '15 at 16:33
• @Sergio Or did you installed any add-on from winedt.org that might interfere with it (e.g. MathGreek)? Mar 12 '15 at 20:41
• I didn´t install nothing at all: furthermore, y erased every file related to WinEdt and re-installed it before asking. The shorcuts work properly, but the "}" one makes Active Keys do not work any more :S Mar 13 '15 at 12:55
• @Sergio Do you have a keyboard with a non-common layout? Mar 13 '15 at 12:59

The solution is to use macros accessible via simple (and meaningful for the context) shortcuts. Here a example on my system: in the MENU="Shortcuts" section of MainMenu.ini (the one in %b, not in %B), I added the lines:

 ITEM="{ }"
MACRO="[InsLabel('','{','}')]"
SHORTCUT="32820::Alt+4"
REQ_DOCUMENT=1


This macro inserts a pair of braces, with the cursor in between. If some text is selected, it puts braces around it.

The shortcut must be both significant and easily accessible. In my case the shortcut is Alt+4 because the left brace is grouped with the 4 key on my French keyboard.

Actually, I didn't do quite that. For an easy management of these personal shortcuts, I put them in a Mainmenu-MoreShortcuts.ini file, and appended at the end of MainMenu.ini:

%INCLUDE="ConfigEx\MainMenu-More_Shortcuts.ini"


Comment aside, you should upgrade to WinEdt V.9…

• Even though it is a good solution, the main aim of this "shortcut" I am looking for is to avoid pressing "Alt+?" or other key combination. That is, "re-asign" the function of any key of my Spanish keyboard in order to get directly, for instance, a backslash. (Maybe something "deeper" than a macro?) I apologize if I did not express my problem properly: English is not my main language. Mar 12 '15 at 11:49
• You can do what you want for only a limited number of re-assignments. I agree that using a key combination for a single character isn't a very good solution. However you sould consider a solution of the type I give: you use a (simple) combination, but you have three things done: insert a pair of left and right braces, and have the cursor in between. My opinion is that it's worth the combination, all the more so as the problem of lonely braces in a TeX document can be tough. Mar 12 '15 at 12:46
• I think I did not considered the efficiency of your suggestion properly: it seems a good solution. Anyway, I will wait a little bit just in case someone gives a solution to the problem I formulated: if there are not any other satisfactory solutions, I will mark your answer as the most helpful. Thank you very much. Mar 12 '15 at 14:45