Pen for OS/2

From EDM2
Jump to: navigation, search

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation

by Judy Schwait

Pen for OS/2 (Pen) is a system-software extension to the IBM OS/2 2.1 operating system that provides support for the pen as an input device in the desktop and portable computing arenas. With a Workplace Shell interface, Pen uses Presentation Manager (PM) for pen-based input and recognition.

Pen currently supports pen digitizers from Kurta, Wacom, and Calcomp that are designed for using the pen as the primary input device. Pen for OS/2 has complete mouse emulation for use with OS/2 and existing applications.

Pen for OS/2 offers the pen as the primary source of input; however, Pen will support existing applications, without modification. This is done through the Pen Compatibility Layer. The Compatibility Layer maps the pen movement to an event, such as a mouse or keyboard. The set of applications that were not designed for use with the pen are called pen-unaware. Compatibility support is provided for OS/2, DOS, and Windows sessions in a PM environment.

With the pen, you use gestures, which are sets of points that are translated into specific commands or command sequences. Pen contains predefined gestures or lets you customize gestures.

Pen-aware and pencentric applications take advantage of the new controls, APIs, and messages defined in the Pen for OS/2 Developer's Toolkit. A developer can use the Pen functions to various degrees. Minimally, a developer can create a pen-aware application, using Pen to detect gestures or pen proximity in their application development. For a full-blown pencentric application, a developer can use all the features contained in the Toolkit to manipulate processing and interpretation of the pen input for the application. Programs can also be selective in the context of character recognition in order to increase accuracy.

The degree to which a program uses the capabilities of Pen determines its pen-awareness. Pen has a variety of components to enhance the pen, as follows:

  • Gesture Practice lets you view and practice drawing predefined shapes.
  • The Sketch Pad is an application that collects strokes and captures images that the user can manipulate through the clipboard.
  • Telepen is a LAN-aware application that allows for communication through handwritten notes and graphics across the LAN.
  • The Pen Tool Bar provides easy access to functions that you might want to perform, such as emulating the right mouse button, starting the Handwriting Pad, or displaying the Pop-Up Keyboard.

Pen's Workplace Shell interface lets you change system-wide values using either the Customization or Device object. In addition, the Customization object lets you train the system for your particular style of handwriting and to change system-wide gesture assignments.

You can also configure gestures on a per object basis through the Gesture page in the Settings notebook of Program object and Program File object. Pen settings also have been added to the Mouse object and Sound objects.

Pen for OS/2 provides device-independence that shields the programmer from the differences in hardware devices. During installation, the device driver (furnished by the manufacturer) registers itself and defines all events and device capabilities with the IBM Pen for OS/2 Device Services. The Device Services layer provides a consistent programming interface to software developers.

Pen for OS/2 extends the functions of the existing PM input subsystem by providing new APIs.

The Virtual Keyboard Playback APIs provide control over the Pop-Up Keyboard tool.

New Window Control APIs provide an interface to the new controls supplied with the Pen extensions, handwriting input control and the sketch control. Use these APIs to customize and manipulate data flows. Two new tools that use these controls are the Handwriting Input Pad and the Sketch Pad.

The Pen Writing Subsystem APIs encompass the arena of seeing and controlling the pen and stroke data and interfacing with the pen subsystem facilities. New OS/2 messages, such as WM_TOUCHDOWN, WM_LIFTOFF, WM_EXIT_PROXIMITY, and WM_RECO report the various asynchronous events and state changes associated with Pen. These messages are sent to applications with the standard mouse-event messages.

The Writing Subsystem APIs handle receiving stroke data from the input queue and the internal cache, determining which window gets the data, and sending PM messages to that window. Pen maintains a stroke buffer that collects all points in the movement of the pen between the touch-down point and the lift-off point. On stroke completion, Pen sends a WM_STROKE message to the application. At this point, the application can access the stroke data through an API.

The main function of the Compatibility Layer is to convert pen events to mouse and keyboard events or to invoke special-purpose command handlers that can be registered with the system. This Layer provides the interface to the pen-unaware applications that are designed to work with mouse and keyboard input. It allows programs to work in the pen environment without being altered for use with the pen.

Some examples of mapping of pen operations to mouse events are:

Touch down and pause Mouse button down
Touch down, pause, move Begin drag or selection
Lift off Mouse button up
Tap Mouse button single click
Double-tap Mouse button double click
Move pen Mouse move

For these unaware applications, the Compatibility Layer will collect strokes and build a doodle on behalf of the application. When this doodle is complete, the Layer tries to resolve the points as a gesture. If a shape is matched, an event is sent to the Recognition Event Delivery (RED) component.

The RED component assists developers in the interpretation of command-recognition events, such as gestures. Its purpose is deliver recognition results to applications. The RED component maps these recognition results to assignments de fined by the system or user. These assignments are accessed through the Program or Program File objects settings and the Pen Customization object settings. Assignments can be predefined commands packaged with Pen, such as Close Window, or they can be the name of a program to be started. The predefined command, Send Keystrokes, lets you play back a set of keystrokes when drawing a gesture.

Pen for OS/2 provides an open architecture with a number of well-defined socket interfaces for device and recognition providers. The pen opens up features in the operating system and applications that were not previously available with the keyboard and the mouse. It allows for freehand drawing, gives a more natural input device, and interprets ink as handwriting and gestures.

We believe that Pen for OS/2 will launch the pen into becoming the primary source of input for OS/2.