Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

suntools(1)

defaultsedit(1)

SWIN(1)  —  USER COMMANDS

NAME

swin − set/get SunView user input options

SYNOPSIS

swin [ −c ] [ −g ] [ −h ] [ −m ] [ -r event value shift_state ] [ -s event value shift_state ] [ -t seconds ]

DESCRIPTION

The swin (set window; analogous to stty(1)) command lets you change some of the input behavior of your SunView environment.  By default, your keyboard input follows your mouse cursor.  This means that in order to type to a window you position the mouse cursor over the window.  This is called keyboard-follows-mouse mode. 

You can specify that the keyboard input continues to go to the same window, regardless of the mouse cursor position, until you take some specific action, like clicking the mouse.  When this is done, you can roam around the screen with the mouse cursor and not change the window to which keyboard input is directed.  Running SunView like this is said to be operating in click-to-type mode. 

When running in click-to-type mode, one user action sets the type-in point in the window that you want to receive keyboard input.  The default user action to do this is the pressing of the left mouse button while positioning the mouse cursor over the new type-in point.  This user action can be changed. 

Another user action restores the previous type-in point in the window that you want to receive keyboard input.  The default user action to do this is the pressing of the middle mouse button while positioning the mouse cursor over the window.  This user action can be changed. 

OPTIONS

−cTurn on click-to-type mode using the default user actions: the left mouse button sets the type-in point and the middle button restores the type-in point.  You can use the defaultsedit(1) program to set click-to-type on permanently; see the SunView/Click_to_Type option. 

−mRun in keyboard-follows-mouse mode. 

−s event value shift_state
Set the user action that sets the type-in point and sets the keyboard input window. The event identifies the particular user action and is one of:

LOC_WINENTER
the mouse cursor entering a window

MS_LEFT
the left mouse button

MS_MIDDLE
the middle mouse button

MS_RIGHT
the right mouse button

decimal_number
place the decimal number of a firm event here; see list of events in /usr/include/sundev/vuid_event.h (avoid function keys, normally unused control-ascii characters are OK, normally unused shift keys are OK). 

value identifies the transition of the event and is one of:

ENTER
the mouse cursor entering a window (use with LOC_WINENTER)

DOWNthe button associated with event went down

UPthe button associated with event went up (avoid this)

The shift_state identifies the state of the shift keys at the time of the event/value pair in order for that pair to be used to control the keyboard input window.  The shift_state is one of:

SHIFT_DONT_CARE
ignore the state of the shift keys

SHIFT_ALL_UP
all the shift keys must be up

SHIFT_LEFT
the left shift key must be down (not the key labelled LEFT)

SHIFT_RIGHT
the right shift key must be down (not the key labelled RIGHT)

SHIFT_LEFTCTRL
the left control key must be down

SHIFT_RIGHTCTRL
the right control key must be down

−r event value shift_state
Set the user action that restores the type-in point and sets the keyboard input window. This user action is swallowed so that the application that owns the window doesn’t see it.  However, if the window already has keyboard input or if the window refuses keyboard input then this user action is passed on through to the application. The parameters to this command are like for −s.  The following example shows modifying the default click-to-type user actions so that a left-shift is required for the restore user event:

        tutorial% swin -c -r MS_MIDDLE DOWN SHIFT_LEFT

−t seconds
SunView synchronizes input so that it doesn’t hand out the next user action until the application fielding the current user action finishes its processing.  This allows type-ahead and mouse-ahead. If an application doesn’t finish processing within a given length of time (process virtual time; not wall clock time), the next user action is handed out anyway. This avoids any one application from hanging the workstation. The −t command sets this time limit.  A seconds value of 0 tells SunView to run unsynchronized; beware of race conditions in this mode.  The default seconds value is 2 and the −c command makes it 10 seconds. 

−gGet the state of the user input options controlled by swin.  If no arguments are supplied to swin then −g is implied. 

−hPrint out a help message that briefly describes the options to swin. 

FILES

/usr/include/sundev/vuid_event.h - list of event codes

SEE ALSO

suntools(1), defaultsedit(1)
Windows and Window-Based Tools: Beginner’s Guide

DIAGNOSTICS

“swin not passed parent window in environment” - must be running suntools already; swin doesn’t work unless SunView is started already. 

BUGS

swin gets you no help in preventing you from specifying −r or −s parameters that are not sensible. 

Sun Release 3.2  —  Last change: 24 December 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026