title: How to capture user selections with dialog
body: <p>I am updating a shell script which uses <a href="http://linux.die.net/man/1/dialog" rel="nofollow">dialog</a> create a text-based UI.</p>
  
  <p>When I create a radiolist or checklist, I can't figure out how to make a selection in the displayed dialog.</p>
  
  <p>For example, taking an example from <a href="http://unstableme.blogspot.com/2009/12/linux-dialog-utility-short-tutorial.html" rel="nofollow">here</a>:</p>
  
  <pre><code>#!/bin/sh
  dialog --backtitle "OS info" --radiolist "Select OS:" 10 40 3 \
          1 "Linux" off \
          2 "Solaris" on \
          3 "HPUX" off \
  2&gt; result.txt
  echo "User selection: " `cat result.txt`
  </code></pre>
  
  <p>In the resulting dialog, I can use cursor keys (or number keys 1-3) to <strong>change</strong> the highlighted item in the list. But I can't figure out how to actually <strong>select</strong> the item (set the X in its control).</p>
  
  <p>When I highlight an item and press ENTER, the output is always "2".</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I find I can make a selection by clicking an item with the mouse. I was expecting it to work with keyboard-only input.</p>
  
  <p>I'd still be interested to know if there is a way to make a selection using the keyboard - I guess there must be.</p>