GEMLIB  0.44.0
Functions
VDI input functions

input functions More...

Functions

void v_hide_c (VdiHdl)
 
void v_show_c (VdiHdl, short reset)
 
void vex_butv (VdiHdl, void *pusrcode, void **psavcode)
 
void vex_curv (VdiHdl, void *pusrcode, void **psavcode)
 
void vex_motv (VdiHdl, void *pusrcode, void **psavcode)
 
void vex_wheelv (VdiHdl, void *pusrcode, void **psavcode)
 
void vex_timv (VdiHdl, void *time_addr, void **otime_addr, short *time_conv)
 
void vq_key_s (VdiHdl, short *state)
 
void vq_mouse (VdiHdl, short *pstatus, short *x, short *y)
 
void vrq_choice (VdiHdl, short cin, short *cout)
 
void vrq_locator (VdiHdl, short x, short y, short *xout, short *yout, short *term)
 
void vrq_string (VdiHdl, short len, short echo, short echoxy[], char *str)
 
void vrq_valuator (VdiHdl, short in, short *out, short *term)
 
void vsc_form (VdiHdl, short form[])
 
short vsin_mode (VdiHdl, short dev, short mode)
 
short vsm_choice (VdiHdl, short *choice)
 
short vsm_locator (VdiHdl, short x, short y, short *xout, short *yout, short *term)
 
short vsm_string (VdiHdl, short len, short echo, short echoxy[], char *str)
 
void vsm_valuator (VdiHdl, short in, short *out, short *term, short *status)
 

Detailed Description

input functions

todo: add description here

Function Documentation

void v_hide_c ( short  handle)

switches the mouse cursor off

Parameters
handleDevice handle
Since
all VDI versions
Note
Use mt_graf_mouse() to switch the cursor on or off.

References VDI_CNTRLMAX.

void v_show_c ( short  handle,
short  reset 
)

'neutralizes' a preceding call of "HIDE CURSOR". If you want to display the mouse cursor immediately without regard to the hide counter, the paramter reset has to be zero.

Parameters
handleDevice handle
reset
  • 0 : display cursor immediately
  • any nonzero value: decrement hide counter and display cursor if necessary
Since
all VDI versions
Note
Use mt_graf_mouse() to switch the cursor on or off.

References VDI_CNTRLMAX.

void vex_butv ( short  handle,
void *  new,
void **  old 
)

installs a routine which is called when a mouse button is pressed

Parameters
handleDevice handle
newaddress of the new routine
oldaddress of the old routine
Since
all VDI versions

Register d0.w contains the button state. The subroutine must save and restore modified registers and call the old status routine.

References VDI_CNTRLMAX.

void vex_curv ( short  handle,
void *  new,
void **  old 
)

establishes a routine in the mouse interrupt

Parameters
handleDevice handle
newaddress of the new routine
oldaddress of the old routine
Since
all VDI versions

The routine will be called if the mouse is moved and d0.w/d1.w contain the coordinates of the mouse cursor. The subroutine must save and restore modified registers and call the old interrupt routine.

Please note that this interrupt routine is called after the one installed by vex_motv(). In contrast to the preceding routine, the mouse coordinates have been clipped.

References VDI_CNTRLMAX.

void vex_motv ( short  handle,
void *  new,
void **  old 
)

establishes a routine in the mouse interrupt

Parameters
handleDevice handle
newaddress of the new routine
oldaddress of the old routine
Since
all VDI versions

The routine will be called if the mouse is moved and d0.w/d1.w contain the coordinates of the mouse cursor. The subroutine must save and restore modified registers and call the old interrupt routine.

References VDI_CNTRLMAX.

void vex_timv ( short  handle,
void *  time_addr,
void **  otime_addr,
short *  time_conv 
)

You can use this function to establish a function in the timer interrupt (etv_timer).

Parameters
handleDevice handle
time_addraddress of the new timer routine
otime_addraddress of the old timer routine
time_convinterrupt interval in ms
Since
all VDI versions

The subroutine has to save and restore modified registers and call the old timer routine

References VDI_CNTRLMAX.

void vex_wheelv ( short  handle,
void *  new,
void **  old 
)

establishes a routine in the wheel mouse interrupt

Parameters
handleDevice handle
newaddress of the new routine
oldaddress of the old routine
Since
Milan-VDI TOS 4.08

The routine will be called if the wheel of a mouse change; d0.w contain the wheel_number, d1.w contain the wheel_amount of the wheel from the mouse. The subroutine must save and restore modified registers and call the old interrupt routine.

References VDI_CNTRLMAX.

void vq_key_s ( short  handle,
short *  state 
)

"SAMPLE KEYBOARD STATE INFORMATION" returns the state of CONTROL, ALTERNATE and the SHIFT key(s).

Parameters
handleDevice handle
statekeyboard (bit numbers):
  • 0: Shift right
  • 1: Shift left
  • 2: Control
  • 3: Alternate
Since
all VDI versions
Note
Use the AES event functions to inquire the keyboard state

References VDI_CNTRLMAX.

void vq_mouse ( short  handle,
short *  pstatus,
short *  x,
short *  y 
)

This function returns the state of the mouse buttons and the mosue position

Parameters
handleDevice handle
pstatusbutton status
x
y
Since
all VDI versions
Note
Use mt_graf_mkstate() or the event functions of the AES.

References VDI_CNTRLMAX.

void vrq_choice ( short  handle,
short  cin,
short *  cout 
)

returns the number of the function key pressed

Parameters
handleDevice handle
cininitialisierende Taste (0)
coutausgew„hlte Funktionstaste
Since
all VDI versions

References VDI_CNTRLMAX.

void vrq_locator ( short  handle,
short  x,
short  y,
short *  xout,
short *  yout,
short *  term 
)

returns the position of the mouse. You can use this function to change the position of the mouse cursor (but you should not because it will only irritate the user). This functions waits until a mouse button is pressed.

Parameters
handleDevice handle
xnew x-coordinate of the mouse cursor
ynew y-coordinate of the mouse cursor
xoutold x-coordinate of the mouse cursor
youtold x-coordinate of the mouse cursor
termMaustastenstatus+31
Since
all VDI versions

References VDI_CNTRLMAX.

void vrq_string ( short  handle,
short  len,
short  echo,
short  echoxy[],
char *  str 
)

returns a string from the keyboard, and returns if the maximum string length is reached or if the user has pressed RETURN.

Parameters
handleDevice handle
lenis the maximum length of the string returned in vdi_intout. If len is negative, the absolute value is considered to be the maximum length and scan codes are returned instead of ASCII values.
echo0: no output 1: echo
echoxy
strinput buffer
Since
all VDI versions

References vdi_array2str(), VDI_CNTRLMAX, and VDI_INTOUTMAX.

void vrq_valuator ( short  handle,
short  in,
short *  out,
short *  term 
)

returns the value of the valuator device

Parameters
handleDevice handle
inInitial value
outOutput value
[option CHECK_NULLPTR] out may be NULL
termTerminator
[option CHECK_NULLPTR] term may be NULL
Since
all VDI versions

The initial value of the valuator is incremented or decremented until a terminating character is struck. Valuator keys are typically the up-arrow and down-arrow keys. Valuator numbers range from 1 to 100. Typical implementation of the up-arrow and down-arrow keys is as follows:

  • Pressing the up-arrow key adds ten to the valuator.
  • Pressing the down-arrow key subtracts ten from the valuator.
  • Pressing the up-arrow key with the Shift key adds one to the valuator.
  • Pressing the down-arrow key with the Shift key subtracts one from the valuator.
Note
This function is not required and may not be available on all devices.

References VDI_CNTRLMAX.

void vsc_form ( short  handle,
short  form[] 
)

modifies the appearance of the mouse cursor

Parameters
handleDevice handle
formcursor data:
  • form[0]: x-coordinate of hot spot
  • form[1]: y-coordinate of hot spot
  • form[2]: must be 1 (REPLACE)
  • form[3]: background color
  • form[4]: foreground color
  • form[5..20]: background mask
  • form[21..36]: foreground mask
Since
all VDI versions
Note
Use mt_graf_mouse() to change the mouse cursor !

References VDI_CNTRLMAX.

short vsin_mode ( short  handle,
short  dev,
short  mode 
)

sets the input mode for the specified device

Parameters
handleDevice handle
devinput device
  • 1: Mouse
  • 2: Cursor
  • 3: Function keys
  • 4: Keyboard
moderequested input mode
  • REQUEST MODE (1): wait until input data is available
  • SAMPLE MODE (2): return device status and input data (if available)
Returns
selected input mode
Since
all VDI versions

References VDI_CNTRLMAX.

short vsm_choice ( short  handle,
short *  choice 
)

If a function key has been pressed "INPUT CHOICE" returns its number.

Parameters
handleDevice handle
choicekey number (1-10)
Returns
0 (no key) or 1 (key pressed)
Since
all VDI versions

References VDI_CNTRLMAX.

short vsm_locator ( short  handle,
short  x,
short  y,
short *  xout,
short *  yout,
short *  term 
)

returns the coordinates of the mouse cursor and sets new coordinates

Parameters
handleDevice handle
xnew x-coordinate of the mouse cursor
ynew y-coordinate of the mouse cursor
xoutold x-coordinate of the mouse cursor
youtold y-coordinate of the mouse cursor
termmouse button + 31
Returns
a bitmap value:
  • bit 0 (0x01): mouse movement
  • bit 1 (0x02): button pressed
Since
all VDI versions

References VDI_CNTRLMAX.

short vsm_string ( short  handle,
short  len,
short  echo,
short  echoxy[],
char *  str 
)

returns a string from the keyboard. "INPUT STRING, SAMPLE MODE" returns if the maximum string length is reached, if the user has pressed RETURN or if the user has not pressed a key.

Parameters
handleDevice handle
lenis the maximum length of the string returned in intout. If max_length is negative, the absolute value is considered to be the maximum length and scan codes are returned instead of ASCII values.
echo0: no output 1: echo
echoxy
strinput buffer
Returns
0 (no input) or the length of the string otherwise.
Since
all VDI versions

References vdi_array2str(), VDI_CNTRLMAX, and VDI_INTOUTMAX.

void vsm_valuator ( short  handle,
short  in,
short *  out,
short *  term,
short *  status 
)

returns the current value of the valuator device

Parameters
handleDevice handle
inInitial value
outNew valuator value
termKeypress, if keypress event occurred.
status
  • 0 = nothing happened
  • 1 = valuator changed
  • 2 = keypress character
Since
all VDI versions

The valuator device is sampled. If the valuator has changed, GEM VDI increments or decrements the valuator value as required. If a terminating event occurs, GEM VDI returns the value. If nothing happens, GEM VDI returns no value. Valuator numbers range from 1 to 100. The suggested keys are the same as for Input Valuator, Request Mode.

Note: This function is not required and may not be available on all devices.

References VDI_CNTRLMAX.