Template Tool Key Shortcuts

Previous discussion was found in this thread

I put together a table - starting with ChemDraw shortcuts and adding some that made sense to me (e.g. typing c# gives you a straight-chain alkyl because those are a pain). Also for some reason ChemDraw doesn’t have a nitrile / cyano group and for mysterious reasons a t-butyl group is “K” rather than “t”.

Other common groups that I missed?

Key Name Key Name Key Name Key Name
a phenyl A acyl 1
b Br B BH2 2 carbonyl
c methyl C Cl 3 phenyl
d deuterium D 4
e ethyl E CO2Me ester 5
f fluorine F CF3 6 cyclohexane
g G 7 cyclopentane
h hydrogen H Cbz 8 -C=CH2
i iodine I isopropyl 9 isopropyl
j J 0 methyl
k sulfone SO2-CH3 K t-butyl
l Cl L Li cn nitrile / cyano nc isocyano
m methyl M MgBr no nitroso ep epoxide
n NH2 N NO2 im imine
o OH O OMe so sulfoxide
p PH2 P phenyl cs C=S thiocarbonyl
q OH Q FMoc nn N=N azo
r R n3 N3 azide
s SH S SiH3
t t-butyl T c2 ethyl Rings
u cyclobutane U c3 propyl C3 cyclopropyl
v cyclopropane V c4 butyl C4 cyclobutyl
w NH2 W c5 pentyl C5 cyclopentyl
x X c6 hexyl C6 cyclohexyl
y Boc Y etc.
z ≡CH Z N3 c0 decyl C0 cyclodecyl
  • deuterium is currently ignored because I haven’t added isotope support.

Here are some suggestions for common ligands. Ideally I’d like to keep these to 3-4 characters?

I guess in light of previous discussions, keeping single-atom ligands like F, Cl, Br, etc. should also be retained.

Other suggestions?

Abbrev. Ligand Abbrev. Ligand Abbrev. Ligand
n ammonia en ethylenediamine edta EDTA
a / o aqua ox oxalate
co carbonyl bpy bipyiridine e2 \eta^2 ethylene
cn cyano acac acetylacetonate e3 \eta^3 allyl
nc isocyano dmpe dimethylphosphinoethane e4 \eta^4 cyclo-octadiene
ncs isothiocyano dppe diphenylphosphinoethane e5 / cp \eta^5 cyclopentadienyl
p phosphine phen phenanthrolene e6 \eta^6 benzene
s thiol
scn thiocyano tpy terpyridine
porph porphin
phth phthalocyanine
salen salen

And part of my reason for making the tables is to insert into the documentation. :slight_smile:

1 Like

E.g., dmg (dimethylglyoxime), pc (phthalocyanine), por (porphyrin).

1 Like

I’ve been doing quite a lot of thinking on this because I think it could be a really nice interface and powerfully enabling. Big wall of text so for the TL;DR skip to the tables that summarize my proposal…


My general thoughts first of all:

  • I like the fact that shortcuts are generally mirrored between the groups and ligands, and I think that’s a good principle to stick to

  • While taking the ChemDraw hotkeys as a starting point is good, I think we shouldn’t be afraid to change it to make it more sensible – just as you suggested yourself

  • I think we should at minimum get rid of the various cases of redundancy, even if that means diverging from ChemDraw

  • I think we should avoid overriding the meaning of the hotkeys for the Draw Tool i.e. the element symbols – at least for the single letters and common double letters

  • We should stick to fragments/radicals rather than saturated molecules. So don’t have a hotkey for cyclohexane, just have cyclohexyl. Ideally they wouldn’t even be available in the groups selection. This keeps it more conceptually consistent and clear, and therefore predictable, for the user.

    • Note that actually the current behaviour of Avogadro already works perfectly for this principle: clicking on an atom replaces the atom with that fragment, while clicking on empty space creates the fragment with an extra hydrogen atom, so for example, adding an phenyl fragment to empty space creates benzene.

So, to cut redundancy in groups:

  • Keep l for Cl, lose C (prefer the easier to type and more commonly used of the two ChemDraw hotkeys)
  • Keep o for OH, lose q
  • Keep n for NH2, lose w
  • Keep a for Ph, lose 3 and P (so that it can be used for phosphorus, see below)
  • Keep c for methyl by analogy with the other organic elements, but put it at c1 too for consistency (my single exception to my anti-redundancy stance), drop 0 and m
  • Similarly, drop e for ethyl
  • Keep I for iPr, drop 9
  • Maybe keep K for tBu to match ChemDraw and drop the other two options
  • This means we can then use T for Troc
  • Drop u and v for cyclobutane/-propane
  • We should pick just one of the azide shortcuts – I favour n3 because then it matches the alkyl chains nicely

My further proposals for groups:

  • Keep the numerical keys free for now, as it’d be very useful to have them available to the user to set custom hotkeys in future
  • Use c# for the complete range of straight-chain alkyl groups methyl through dodecyl (extend the range)
  • It’s fine to use C# for the complete range of cycloalkyl groups starting at cyclopropyl, but have y# as an alternative because it is easier to type (no shift release between the letter and number)
  • Move vinyl to V
  • Move acetylenyl to W so that it’s paired with vinyl and the two can be remembered as number of bonds = number of vertical lines in the letter
  • Move carbonyl to co so it’s consistent with no and so
  • Make capital O OOH, and in general have shift + organic element letters be an oxidized form
  • Move silicon to z so that S and Si can each have oxidized forms with shift
  • Move bromine to r since it’s unused, and have b as boron so that it can have an oxidized form with shift
  • Move Li to li so that it matches the Draw Tool
  • Extend the f/F for F/CF3 to the other halogens, and to deuterium (even though it’s not yet implemented)
  • I would suggest some extra protecting groups such as Bn/Bz, Ms/Ts/Ns/Tf

This would be the result:

Single stroke

Key Name Key Name
a phenyl A acyl
b BH2 B B(OH)2
c CH3 C CH2OH
d D D CD3
e E
f fluorine F CF3
g G
h (hydrogen) H Cbz
i iodine I isopropyl
j J
k (potassium) K tert-butyl
l chlorine L CCl3
m M MgBr
n NH2 N NHOH
o OH O OOH
p PH2 P P(OH)2
q Q FMoc
r bromine R CBr3
s SH S SSH
t T Troc
u (uranium) U
v (vanadium) V –C=CH2
w (tungsten) W –C≡CH
x X
y (yttrium) Y Boc
z SiH3 Z Si(OH)3

2-stroke carbon chains and rings

Key Name Key Name
c1 methyl
c2 ethyl
c3 propyl C3 or y3 cyclopropyl
c4 butyl C4 or y4 cyclobutyl
c5 pentyl C5 or y5 cyclopentyl
c6 hexyl C6 or y6 cyclohexyl
etc.
c10 or c0 decyl C10/C0/y10/y0 cyclodecyl
c11 undecyl C11 or y11 cycloundecyl
c12 dodecyl C12 or y12 cyclododecyl

Organic functional groups

Combo Formula Name Combo Formula Name
co C(=O)H carbonyl CO C(=O)OH carboxylic acid
no N=O nitroso NO NO2 nitro
so S(=O)H sulfoxide
cn CH=NH imine CN C≡N cyano/nitrile
nc N=CH2 imine NC N≡C isocyano/isonitrile
cs C(=S)H thiocarbonyl
nn N=NH azo

Miscellaneous 2- and 3-stroke hotkeys

Key Name
a3 azide
bn benzyl
bz benzoyl
ep epoxide
li Li
mes mesityl
ms mesyl
ns nosyl
piv Piv
tf triflyl
tr trityl
ts tosyl

You might say “Where’s the ester, the sulfone, why take them out? And why get rid of OMe, surely that’s useful?”. I have a proposal on how to handle organic functional groups in a nice and mostly systematic way – I’ll post it tomorrow.

Oh and I reckon the reasoning behind ChemDraw’s K for t-Bu is that it looks like it visually :slight_smile:

By the way, assuming the hotkeys would be hard-coded somewhere, I’d be more than happy to help with doing the tedious leg work of specifying all the combinations. Also with generating reasonable structures for the fragments repo for anything that’s missing.

Actually writing a hotkey mechanism for the Template Tool is probably beyond me though.

I definitely want to have some discussion because a few of the ChemDraw choices seem weird and they leave out a wide range of groups. (No nitrile, no phosphate, etc.). Some of your suggestions seem reasonable.

On the other hand, some redundancy seems okay, and a few cases the more common functional group requires a shift key.

no (or no2) = nitro .. way more common than nitroso IMHO
cn = cyano / nitrile

And I can see that generally you’re trying to have the more oxidized form with shift, but is NHOH that common? I think NO2 is much more useful as “N”

It does, but I still don’t understand why they didn’t use t which seems way easier to remember.

And of course anything you want to propose needs to be added to the fragments repository.

Most of the code is already there. It’s mostly going to be a big switch statement, e.g avogadrolibs/avogadro/qtplugins/templatetool/templatetool.cpp at de4dbfe7c48ddf734a653c241f522de82bf2cb39 · OpenChemistry/avogadrolibs · GitHub

I can certainly add in a few of the easy cases to get things started.