lib

KKbdAccessExtensions Class Reference

#include <kkbdaccessextensions.h>

Inherits QObject.

List of all members.


Detailed Description

KKbdAccessExtensions is an object that improves accessibility for motor impaired users who may not be able to easily use a mouse.

It adds two new capabilities using the keyboard:

  • Resizing and positioning of panel widgets derived from QSplitter and QDockWindow.
  • Setting focus to any widget that accepts focus.

Sizing Mode

Users may press F8 or Shift-F8 (defaults) to enter sizing mode. A sizing icon appears on the first QSplitter or QDockWindow handle found in the application (F8) or the last such handle (Shift+F8). (A "handle" is the divider bar that appears to the left, right, above, or below each panel of a QSplitter or QDockArea.)

Once in sizing mode, the following functions are available via the keyboard:

  • F8 Moves to the next sizing handle. After the last handle, exits sizing mode.
  • Shift+F8 Moves to the previous sizing handle. After the first handle, exits sizing mode.
  • Esc Exits sizing mode.
  • LeftArrow When on a vertical sizing handle, moves the handle to the left. When on a horizontal sizing handle, moves the handle up.
  • RightArrow When on a vertical sizing handle, moves the handle to the right. When on a horizontal sizing handle, moves the handle down.
  • UpArrow When on a vertical sizing handle, moves the handle to the left. When on a horizontal sizing handle, moves the handle up.
  • DownArrow When on a vertical sizing handle, moves the handle to the right. When on a horizontal sizing handle, moves the handle down.
  • PgUp Like LeftArrow or UpArrow, but moves the handle 5X farther to the left or up.
  • PgDn Like RightArrow or DownArrow, but moves the handle 5X farther to the right or down.
  • Enter (On numeric keypad). When on the handle of a QDockWindow, undocks or docks the widget. Ignored when on the handle of a QSplitter.

The default step size for each arrow key press is 10 pixels.

When a QDockWindow is undocked, the sizing icon appears in the center of the window. The arrow keys and PgUp/PgDn move the undocked window on the screen. Shifted arrow keys and PgUp/PgDn decrease/increase the size of the undocked window.

When the sizing icon is on a sizing handle, the mouse may also be used to move the handle without having to click and drag. When moving the mouse while sizing icon is on an undocked QDockWindow, the window moves with the mouse. Holding Shift down while moving the mouse sizes the QDockWindow.

Note:
Users can also move and size undocked windows using the Window Operations Menu (Alt+F3).
Clicking any mouse button exits sizing mode.

When entering sizing mode, the position of the mouse cursor is saved and restored when exiting sizing mode.

For a QSplitter or QDockWindow to be found, it must be in the kapp::allWidgets() list.

Focus Setting

Users can press Alt-F8. A small box appears in the upperleft corner of each visible widget on the screen that can accept focus. Each box is assigned a single letter or digit. User can press the corresponding key to set focus to the widget.

At most 36 such shortcuts are possible. If any application shortcuts are single letters or digits, those shortcuts are not in any of the boxes.

Clicking any mouse button exits Focus Setting mode.

Notes

The F8, Shift+F8, and Alt+F8 keys are KShortcuts and therefore user may choose different keys in the application's Configure Shortcuts dialog.

Note:
At present, these shortcuts may not be multi-key. If user sets multi-key shortcuts, they will not work.
F8/Shift+F8 are the default shortcuts because these are the keys used for similar functionality in GNOME and Java SWT.

Definition at line 110 of file kkbdaccessextensions.h.


Public Member Functions

 KKbdAccessExtensions (KMainWindow *parent, const char *name=0)
virtual ~KKbdAccessExtensions ()
int stepSize () const
void setStepSize (int s)

Protected Member Functions

bool eventFilter (QObject *o, QEvent *e)
QWidgetList * getAllPanels ()
void nextHandle ()
void prevHandle ()
void exitSizing ()
void resizePanelFromKey (int key, int state)
void resizePanel (int dx, int dy, int state)
void showIcon ()
void hideIcon ()
void displayAccessKeys ()
bool handleAccessKey (const QKeyEvent *ev)

Constructor & Destructor Documentation

KKbdAccessExtensions::KKbdAccessExtensions ( KMainWindow parent,
const char *  name = 0 
)

Constructor.

Parameters:
parent KMainWindow of the application. Required.
name (optional) Name of this object.

Definition at line 160 of file kkbdaccessextensions.cpp.

KKbdAccessExtensions::~KKbdAccessExtensions (  )  [virtual]

Destructor.

Definition at line 180 of file kkbdaccessextensions.cpp.


Member Function Documentation

int KKbdAccessExtensions::stepSize (  )  const

Returns number of pixels panel is sized for each arrow key pressed.

Default is 10.

Definition at line 187 of file kkbdaccessextensions.cpp.

void KKbdAccessExtensions::setStepSize ( int  s  ) 

Sets number of pixels panel is sized for each arrow key pressed.

Definition at line 189 of file kkbdaccessextensions.cpp.

bool KKbdAccessExtensions::eventFilter ( QObject *  o,
QEvent *  e 
) [protected]

Event filter installed on kapp object.

Definition at line 191 of file kkbdaccessextensions.cpp.

QWidgetList * KKbdAccessExtensions::getAllPanels (  )  [protected]

Retrieves a list of all Splitter and DockArea widgets in the application.

Definition at line 275 of file kkbdaccessextensions.cpp.

void KKbdAccessExtensions::nextHandle (  )  [protected]

Advances to the next Panel handle.

If not currently in resizing mode, turns it on.

Definition at line 299 of file kkbdaccessextensions.cpp.

void KKbdAccessExtensions::prevHandle (  )  [protected]

Moves to the previous Panel handle.

If not currently in resizing mode, turns it on.

Definition at line 333 of file kkbdaccessextensions.cpp.

void KKbdAccessExtensions::exitSizing (  )  [protected]

Exits Sizing mode.

Definition at line 381 of file kkbdaccessextensions.cpp.

void KKbdAccessExtensions::resizePanelFromKey ( int  key,
int  state 
) [protected]

Moves panel handle based on key pressed.

Definition at line 517 of file kkbdaccessextensions.cpp.

void KKbdAccessExtensions::resizePanel ( int  dx,
int  dy,
int  state 
) [protected]

Moves panel handle based on deltaX and deltaY and state of keyboard modifier keys.

Definition at line 459 of file kkbdaccessextensions.cpp.

void KKbdAccessExtensions::showIcon (  )  [protected]

Displays the sizer icon.

Definition at line 389 of file kkbdaccessextensions.cpp.

void KKbdAccessExtensions::hideIcon (  )  [protected]

Hides the sizer icon.

Definition at line 454 of file kkbdaccessextensions.cpp.

void KKbdAccessExtensions::displayAccessKeys (  )  [protected]

Displays the access keys.

Definition at line 548 of file kkbdaccessextensions.cpp.

bool KKbdAccessExtensions::handleAccessKey ( const QKeyEvent *  ev  )  [protected]

Handles an access keypress.

Definition at line 624 of file kkbdaccessextensions.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys