

xcalc accepts all of the standard toolkit command line options along with two additional options:
Calculator Key Usage (TI mode): The numbered keys, the +/ key, and the +, , *, /, and = keys all do exactly what you would expect them to. It should be noted that the operators obey the standard rules of precedence. Thus, entering ``3+4*5='' results in ``23'', not ``35''. The parentheses can be used to override this. For example, ``(1+2+3)*(4+5+6)='' results in ``6*15=90''.
The entire number in the calculator display can be selected, in order to paste the result of a calculation into text.
The action procedures associated with each function are given below.
These are useful if you are interested in defining a custom calculator.
The action used for all digit keys is digit(n),
where n is the corresponding digit, 0  9.
Calculator Key Usage (RPN mode):
The number keys, CHS (change sign), +, , *, /, and ENTR keys all do exactly
what you would expect them to do. Many of the remaining keys are the same as
in TI mode. The differences are detailed below. The action procedure
for the ENTR key is enter().
Finally, there are two additional action procedures: bell(), which rings the bell; and selection(), which performs a cut on the entire number in the calculator's ``liquid crystal'' display.
Accelerators are shortcuts for entering commands. xcalc provides some sample keyboard accelerators; also users can customize accelerators. The numeric keypad accelerators provided by xcalc correspond to the keypad of a standard calculator. The accelerators defined by xcalc on the main keyboard are given below:
Keyboard  

TI Key  HP Key  Accelerator  TI Function  HP Function 
SQRT  SQRT  r  squareRoot()  squareRoot() 
AC  ON  space  clear()  clear() 
AC  <  Delete  clear()  back() 
AC  <  Backspace  clear()  back() 
AC  <  ControlH  clear()  back() 
AC  Clear  clear()  
AC  ON  q  quit()  quit() 
AC  ON  ControlC  quit()  quit() 
 
INV  i  i  inverse()  inverse() 
sin  s  s  sine()  sine() 
cos  c  c  cosine()  cosine() 
tan  t  t  tangent()  tangent() 
DRG  DRG  d  degree()  degree() 
 
e  e  e()  
ln  ln  l  naturalLog()  naturalLog() 
y^x  y^x  ^  power()  power() 
 
PI  PI  p  pi()  pi() 
x!  x!  !  factorial()  factorial() 
(  (  leftParen()  
)  )  rightParen()  
 
/  /  /  divide()  divide() 
*  *  *  multiply()  multiply() 
      subtract()  subtract() 
+  +  +  add()  add() 
=  =  equal()  
 
0..9  0..9  0..9  digit()  digit() 
+/  CHS  n  negate()  negate() 
 
x:y  x  XexchangeY()  
ENTR  Return  enter()  
ENTR  Linefeed  enter() 
++++++    Keyboard    ++++++ TI Key  HP Key  Accelerator  TI Function  HP Function  ++++++ SQRT  SQRT  r  squareRoot()  squareRoot()  ++++++ AC  ON  space  clear()  clear()  ++++++ AC  <  Delete  clear()  back()  ++++++ AC  <  Backspace  clear()  back()  ++++++ AC  <  ControlH  clear()  back()  ++++++ AC   Clear  clear()   ++++++ AC  ON  q  quit()  quit()  ++++++ AC  ON  ControlC  quit()  quit()  ++++++       ++++++ INV  i  i  inverse()  inverse()  ++++++ sin  s  s  sine()  sine()  ++++++ cos  c  c  cosine()  cosine()  ++++++ tan  t  t  tangent()  tangent()  ++++++ DRG  DRG  d  degree()  degree()  ++++++       ++++++ e   e  e()   ++++++ ln  ln  l  naturalLog()  naturalLog()  ++++++ y^x  y^x  ^  power()  power()  ++++++       ++++++ PI  PI  p  pi()  pi()  ++++++ x!  x!  !  factorial()  factorial()  ++++++ (   (  leftParen()   ++++++ )   )  rightParen()   ++++++       ++++++ /  /  /  divide()  divide()  ++++++ *  *  *  multiply()  multiply()  ++++++       subtract()  subtract()  ++++++ +  +  +  add()  add()  ++++++ =   =  equal()   ++++++       ++++++ 0..9  0..9  0..9  digit()  digit()  ++++++ +/  CHS  n  negate()  negate()  ++++++       ++++++   x:y  x   XexchangeY()  ++++++   ENTR  Return   enter()  ++++++   ENTR  Linefeed   enter()  ++++++
xcalc has a large application defaults file which specifies the position, label, and function of each key on the calculator. It also gives translations to serve as keyboard accelerators.
The foreground and background colors of each calculator key can be individually specified. For the TI calculator, a possible color resource specification might be:
XCalc.ti.XmPushButton.background: gray50
XCalc.ti.XmPushButton.foreground: white
For each of buttons 20, 25, 30, 35, and 40, specify:
XCalc.ti*button20.background: black
XCalc.ti*button20.foreground: white
For each of buttons 22, 23, 24, 27, 28, 29, 32, 33, 34, 37, 38, and 39:
XCalc.ti*button22.background: white
XCalc.ti*button22.foreground: black
XCalc xcalc
XmForm ti
XmFrame bevel
XmForm screen
XmLabel M
XmLabel LCD
XmLabel INV
XmLabel DEG
XmLabel RAD
XmLabel GRAD
XmLabel P
XmpTable pad
XmPushButton button1
XmPushButton button2
XmPushButton button3
XmPushButton button4
XmPushButton button5
XmPushButton button6
XmPushButton button7
XmPushButton button8
XmPushButton button9
XmPushButton button10
XmPushButton button11
XmPushButton button12
XmPushButton button13
XmPushButton button14
XmPushButton button15
XmPushButton button16
XmPushButton button17
XmPushButton button18
XmPushButton button19
XmPushButton button20
XmPushButton button21
XmPushButton button22
XmPushButton button23
XmPushButton button24
XmPushButton button25
XmPushButton button26
XmPushButton button27
XmPushButton button28
XmPushButton button29
XmPushButton button30
XmPushButton button31
XmPushButton button32
XmPushButton button33
XmPushButton button34
XmPushButton button35
XmPushButton button36
XmPushButton button37
XmPushButton button38
XmPushButton button39
XmPushButton button40