The chemical formula has been an enemy of the keyboard since typing was invented. It's a wild horse, a bucking mustang that can never be properly domesticated.
Typing a formula of even moderate complexity is slow and eror-prone: it requires the use of both upper and lowercase letters, subscript (and often superscript) numerals, brackets (both round and square), and a medley of special symbols, like "+", "-", and "∙".
The tedium of typing formulae is compounded by mobile devices whose touchscreen keyboards are small and rob the typist of important haptic feedback. The standard assistive tools on which we've come to rely for text-messaging and email -- predictive typing and autocorrection -- stand by flummoxed and useless like mute horse-whisperers as the mustang gallops away.
Chemistry calculators for iPhone fall into two broad categories of formula entry:
- Those providing chemistry-specific keyboards, i.e., having dedicated keys for the elements and numerals.
- Those providing either the standard, built-in alphanumeric keyboard, or a chemistry-specific variant of it.
The disadvantages of the second approach are that most element symbols require two key presses for the individual letters and another for correct capitalization. (Correct capitalization is essential: consider the difference between CO and Co, for example.) For a given element, the keyboard is crowded with characters you don't need, and the touch targets are small. There's also the constant need to switch between alpha and numeric keyboard views.
Chemistry-specific keyboards go a long way to overcoming these limitations. For example, they require you to make only two taps to enter the formula Cl2 (tap "Cl", then tap "2") while the standard keyboard makes you tap five times: tap for upper case, tap "C", keyboard automatically returns to lowercase, tap "l", tap to switch to numeric view, and finally tap "2". Chemistry-specific keyboards don't completely eliminate the problem of small touch tagets, but they do enable the targets to be somewhat larger than the standard size by ridding the keyboard of unnecessary buttons. This also serves to reduce visual clutter and therefore also hunting for the appropriate key. (Some apps relying on the built-in keyboard, such as EleMints (shown), feature intelligent autocapitalization.)
The chemistry-specific keyboard is not without its own problems on the small-screen iPhone, however. Its major failing is that the screen is insufficiently large to accommodate dedicated keys for all the elements in the periodic table. So, while the most common elements (C, H, N, O, P, S and Cl) and maybe a few others (depending on the app's design) might be shown on the primary keyboard, the user is forced to scroll through a list to enter other less frequently used elements. Entering the symbol "Ru" would require three taps from the built-in alphanumeric keyboard (tap for upper case, tap "R", keyboard automatically returns to lowercase, tap "u"). While it's not optimal to require three taps to enter a single symbol, these actions can be made in relatively quick succession by the practised typist. The so-called "chemistry-specific" keyboard would require at least as many gestures, but these would take much longer: tap to show list of all elements (ordered either alphabetically or by atomic number), swipe to scroll down to ruthenium, tap "Ru".
ChemTrix for iPhone addresses this problem by providing four programmable buttons on its principal (chemistry-specific) keyboard that may be set to any element (or group – in the screenshot above they are set to carboxybenzyl, cyclooctadiene, and the elements platinum and cadmium). The app also remembers the five most recently selected elements and keeps these at the top of the list of all elements to make finding them again easier and quicker. A future version will learn which elements are most frequently typed and automatically promote these to the principal keyboard. With these adaptations, I hope that the principal failing of chemistry-specific keyboards may be overcome.
In many ways, the choice between chemistry-specific and built-in keyboards echoes the choice between software and hardware keyboards on mobile devices. The former is more flexible and can be tailored to specific languages and contexts, while the latter is more familiar to many users and is often quicker for everyday typing. Both input methods have ardent supporters and detractors. I have chosen the software/specific option for ChemTrix, while competitive apps feature (sometimes tweaked) hardware/generic keyboards. I'd be very interested to hear the preferences of chemistry app users in this debate. Drop me a line at firstname.lastname@example.org.