SDGT - The Single Display Groupware Toolkit

The SDG Toolkit is a framework for designing single display groupware applications. SDGT is a COM object designed for managing multiple mice and keyboards.

To learn more about the SDG Toolkit read our CSCW Paper

Download

Overview

 

The SDG Toolkit simplifies Single Display Groupware development by providing the following features.

  • Automatic detection of all USB and serial windows mice and keyboards present in the system  
  • Event-based interface for detecting mouse movements and button clicks, and keyboard events
  • Display of multiple cursors, one for each mouse
  • Individually customizable cursors (loaded from .bmp, .cur and .ani files), hotspots and text labels/fonts
  • Coordinates relative to any window
  • Movement Restriction to the window
  • For table top displays where orientation matters, cursor text labels can be rotated, and mouse movements can be set relative to the different sides of the table (see figure above).

Limitations:

  • Only works with Windows XP!
  • Mice are not hot swappable as the SDG application is running

 

 

sdgControl


Manages all mice and keyboards in the system, eg the events they generate as well as their generic properties.

Properties

Property Access Description
TotalKeyboards as Integer Get by Reference The total number of keyboards present on the system
TotalMice as Integer Get by Reference The total number of mice present on the system 
Mouse (Index as Integer) as sdgMouse Get, Put by Reference The sdgMouse corresponding to the specified index is set or returned
LastMouseClick as Integer Get by Reference Returns the last mouse that sent a Mouse Down event.  Usually used to see which mouse was used to click a traditional non - SDG widget.  However this is not reliable and may disappear in future versions.
LastKeyboardPress as Integer Get by Reference Returns the last keyboard that sent a key down event.  Usually used to see which keyboard was used to type into a traditional non - SDG widget.  

Methods

Signature Description
setRelativeTo (hWnd as long, RestrictTohWnd as Boolean) hWnd: Sets all of the absolute screen coordinates to be relative to the hWnd specified rather that returning screen coordinates. 

Restrict to hWnd: If true, restricts all mouse cursors to stay within the window specified in the setRelativeTo function.  If false, the mouse cursor can go anywhere on the display.  For greater control, this property can be set individually within the sdgMouse control.  Default is false.

Events

Signature Description
MouseDown (MouseID as Long, Button as Long, X as Long, Y as Long)  Raised when a mouse button is pressed
MouseUp (MouseID as Long, Button as Long, X as Long, Y as Long)  Raised when a mouse button is released
MouseMove (MouseID as Long, Button as Long, X as Long, Y as Long)  Raised when any mouse event is received
MouseWheel (MouseID as Long, WheelDelta as Long) Raised when the mouse wheel is moved. Wheel delta is measured in detantes ie. one notch of the mouse wheel
KeyDown (MouseID as Long, KeyCode as Long, Shift as Long) Raised when the keyboard is pressed. KeyCode is consistent with Visual Basic
KeyPress (KeyboardID as Long, KeyAscii as Long) Raised when the keyboard is pressed. KeyAscii represents the ascii equivalent for any alphanumeric characters
KeyUp (KeyboardID as Long, KeyCode as Long, Shift as Long) Raised when the keyboard is release. KeyCode is consistent with Visual Basic

sdgMouse


The SDG Mouse controls an individual mouse cursor.  Static cursor images are loadable from .bmp and .cur files.  Animated cursors are loadable from .ani files.  Below is an illustration of an animated cursor with text

Properties

Property Access Description
X as long Get, Put by Reference Returns or sets the current X coordinate of the cursor.  If the X coordinate is set the cursor will be moved
Y as long Get, Put by Reference Returns or sets the current Y coordinate of the cursor.  If the Y coordinate is set the cursor will be moved
DegreeRotation as long Get, Put by Reference  For table top displays: Returns or sets the movement orientation of the cursor in degrees.  This feature is useful for table top display in which one user is kitty-corner or across the table from another user
FrameIndex as long Get, Put by Reference  For animated cursors only: Returns or Sets the current frame in an animated cursor. Ignored if an animated cursor is not used.
FrameTotal as long Get by Reference For animated cursors only: Returns the total number of frames in an animated cursor.  Example: g(2).FrameIndex = (g(2).FrameIndex + 1) Mod FrameTotal
Picture as String Get, Put by Value The file path of the image used to represent the cursor for the current mouse.  It must be a .bmp, .cur or .ani file.  Note: The file specified must be a 24-bit colour bitmap of any size, or a .cur file whose image size is a power of two.
HotSpotX as long Get, Put by Reference Returns or sets the cursor X hotspot location
HotSpotY as long Get, Put by Reference Returns or sets the cursor Y hotspot location
Text as String Get, Put by Value Sets the text caption for the cursor
TextFont as String Get, Put by Value Sets the font of the cursors text label.  Text Font will default to Arial if that font is not found.
TextRotation as long Get, Put by Reference For table top displays: Sets the rotation of the text caption.  This follows the same direction as the Degree Rotation property.  The example on the right shows a text caption rotated by 180°.

 

TextX as long Get, Put by Reference Sets or returns the location of the X text caption relative to the top left corner of the cursor
TextY as long Get,Put By Reference Sets or returns the location of the Y text caption relative to the top left corner of the cursor

Methods

Signature Description
setRelativeTo (hWnd as long, RestrictTohWnd as Boolean) hWnd: Sets the absolute screen coordinates to be relative to the hWnd specified rather that returning screen coordinates. 

Restrict to hWnd: If true, restricts the individual mouse cursor to stay within the window specified in the setRelativeTo function.  If false, the mouse cursor can go anywhere on the display.  For greater control, this property can be set individually within the sdgMouse control.  Default is false.


Example Programs

 

These sample programs are included in the Example Programs zip file.

  • SDG Minimal Sketch - The minimum amount of code required to create a simple sketch application
  • SDG Sketch Pad - Illustrates how to use the sdg toolkit to create a simple drawing application.
  • SDG Widget - Illustrates how the sdg toolkit is designed to work with any VB widget

  • SDG Keyboard - Illustrates how the sdg toolkit is designed to work with keyboards

Below is the full code required to make the minimal sketch program

Dim WithEvents g As sdgControl
Dim drawNow As Boolean

Private Sub Form_Load()
    
    drawNow = False
    Set g = New sdgControl
    g.setRelativeTo Form1.hWnd
    
End Sub

Private Sub g_MouseDown(ByVal MouseNumber As Long, ByVal Button As Long, ByVal X As Long, ByVal Y As Long)
    drawNow = True
End Sub

Private Sub g_MouseMove(ByVal MouseNumber As Long, ByVal Button As Long, ByVal X As Long, ByVal Y As Long)
    If drawNow = True Then
        Form1.DrawWidth = (MouseNumber + 1) * 2
        Form1.Line (X, Y)-(X + 1, Y + 1)
    End If
End Sub

Private Sub g_MouseUp(ByVal MouseNumber As Long, ByVal Button As Long, ByVal X As Long, ByVal Y As Long)
    drawNow = False
End Sub

This web site was created by Edward Tse, the last update was August 22, 2002 03:22 PM

Please send comments or suggestions to webdude@edwardtse.com

 

License Terms