An electronic device (200), such as a computer, a mobile phone or a PDA,
is controlled by an arrangement comprising a handheld input unit (300),
which records images and converts these to text strings comprising
character sequences. The text strings recorded by the input unit (300)
are used when controlling the electronic device (200). A
signal-processing unit (210) receives the text strings, matches the
format of a current text string to a format database comprising
predetermined formats, each of which is associated with a command, and
generates the command associated with the current text string, so as to
control the electronic device (200). The signal-processing unit (210) can
search for an address in the current text string. If an address is found,
the signal-processing unit (210) causes the electronic device (200) to
connect to the address. The input unit, which is capable of operating in
different function modes, such as a mouse function mode and a text
inputting mode, is arranged to automatically change between the different
function modes on the basis of the contents of the recorded images,
typically in identification of a predetermined pattern.