SftTree/DLL 6.5

KeyHandling

Softel vdm, Inc.

Defines keystrokes intercepted during cell editing.

C

void WINAPI SftTree_GetKeyHandling(HWND hwndCtl, BYTE* lpVirtKeyIntercept,
      TCHAR* virtKey, BYTE* virtMask);
void WINAPI SftTree_SetKeyHandling(HWND hwndCtl, const BYTE* lpVirtKeyIntercept);
void WINAPI SftTreeSplit_GetKeyHandling(HWND hwndCtl, BYTE* lpVirtKeyIntercept,
      TCHAR* virtKey, BYTE* virtMask);
void WINAPI SftTreeSplit_SetKeyHandling(HWND hwndCtl, const BYTE* lpVirtKeyIntercept);

C++

void CSftTree::GetKeyHandling(BYTE* lpVirtKeyIntercept,
      TCHAR* virtKey, BYTE* virtMask) const;
void CSftTree::SetKeyHandling(const BYTE* lpVirtKeyIntercept);
void CSftTreeSplit::GetKeyHandling(BYTE* lpVirtKeyIntercept,
      TCHAR* virtKey, BYTE* virtMask) const;
void CSftTreeSplit::SetKeyHandling(const BYTE* lpVirtKeyIntercept);

Parameters

hwndCtl

The window handle of the tree control.

lpVirtKeyIntercept

The address of a 256 byte storage area (the keystroke table).  

GetKeyHandling updates the area at the specified address with a copy of the currently defined keystroke table.  This parameter may be NULL.

SetKeyHandling uses the area at the specified address and copies it to its keystroke table, making the new table the currently defined keystroke table.  This parameter may be NULL, in which case the currently defined keystroke table is cleared.

virtKey

Returns the last intercepted keystroke.  GetKeyHandling returns a valid virtKey value only while a SFTTREEN_KEYINTERCEPTED notification is being processed.  This parameter may be NULL.

virtMask

Returns the last intercepted keystroke attribute.  GetKeyHandling returns a valid virtMask value only while a SFTTREEN_KEYINTERCEPTED notification is being processed.  This parameter may be NULL.

SFTTREE_HANDLEPURE

The keystroke was intercepted and was used without the Control and without the Shift key.

SFTTREE_HANDLECTRL

The keystroke was intercepted and occurred in combination with the Control key.  This value can occur in combination with the SFTTREE_HANDLESHIFT value.

SFTTREE_HANDLESHIFT

The keystroke was intercepted and occurred in combination with the Shift key.  This value can occur in combination with the SFTTREE_HANDLECTRL value.

Comments

The GetKeyHandling and SetKeyHandling functions define keystrokes intercepted during cell editing.

Information specific to SftTree/DLL Windows Mobile EditionWindows Mobile Edition:  GetKeyHandling and SetKeyHandling are not supported. 

To simplify handling of special keystrokes such as Escape, Return, arrow keys, which are normally handled by a child window during cell editing, these can be intercepted by the application using SetKeyHandling.  Once a key stroke for a child window is intercepted during cell editing, the SFTTREEN_KEYINTERCEPTED notification occurs.  The intercepted key can be retrieved using the GetKeyHandling function.  Using SetKeyHandling eliminates the need to subclass the child window, simplifying the implementation of cell editing.

To define intercepted keystrokes, the GetKeyHandling function is used to retrieve the current keystroke table.  The keystroke table can then be modified, setting the desired attributes.  Finally, the keystroke table is updated by a call to the SetKeyHandling function.

The keystroke table is a 256 byte storage area, one byte for each virtual key code (such as VK_ESCAPE, VK_RETURN, VK_UP, etc.).  Each byte contains one or a combination of the following values defining how the virtual key is processed.  The virtual key code is used as index into the keystroke table.

SFTTREE_HANDLENONE

The keystroke is not intercepted.

SFTTREE_HANDLEPURE

The keystroke is intercepted if it is used without the Control and without the Shift key.

SFTTREE_HANDLECTRL

The keystroke is intercepted if it is used with the Control key.

SFTTREE_HANDLESHIFT 

The keystroke is intercepted if it is used with the Shift key.

Any keystroke that is intercepted during cell editing generates a SFTTREEN_KEYINTERCEPTED notification, to be handled by the application.

See Also  C/C++ API  |  CategoriesNotifications

 


Feedback / comments / error reports for this topic
© 2009 - Softel vdm, Inc. - www.softelvdm.com