A contact sensing device is provided. The sensing device comprises a housing
having
a nib and a position sensor mounted in the housing. The position sensor generates
position data when the nib is positioned in contact with a surface having coded
data disposed thereon, the coded data being indicative of a plurality of locations
within the region and the position data being indicative of the position of the
nib relative to the region. The position sensor comprises imaging optics, an image
sensor, and a processor. The position sensor is configured to generate the position
data by: (a) capturing, using the image sensor and via the imaging optics, an image
of coded data in the vicinity of the nib; (b) determining, using the processor
and from the image, data indicative of a rotation and a position of the region
relative to the imaging optics; (c) determining, using the processor and from the
data and a known relationship between the imaging optics and the nib, the position
of the nib relative to the region; and (d) generating, using the processor and
from the position of the nib, the position data.