IQueryKeyUsage::FlagKeysUsed

This method gets the flags of the keys used.

Syntax

HRESULT FlagKeysUsed( long lKeysUsed, long lKeysEaten );

Parameters

lKeysUsed
Long integer that contains the keystrokes used. It is any combination of the following flags.
QKU_VK_LEFT
The LEFT ARROW key.
QKU_VK_UP
The UP ARROW key.
QKU_VK_RIGHT
The RIGHT ARROW key.
QKU_VK_DOWN
The DOWN ARROW key.
QKU_VK_RETURN
The ENTER key.
lKeysEaten
Long integer that contains the keystrokes discarded. It is any combination of the following flags.
QKU_VK_LEFT
The LEFT ARROW key.
QKU_VK_UP
The UP ARROW key.
QKU_VK_RIGHT
The RIGHT ARROW key.
QKU_VK_DOWN
The DOWN ARROW key.
QKU_VK_RETURN
The ENTER key.

Return Values

NOERROR indicates success. If an error occurs, the appropriate HRESULT value is returned.

Remarks

This method allows you to notify a NavArrow control that your form or application can handle particular keystrokes. The NavArrow control queries the Forms Manager about such keystrokes by posting a WM_QUERYKEYUSAGE message. The lparam of this message is a pointer to an IQueryKeyUsage interface. The form sink or application sink that processes keystrokes should call IQueryKeyUsage::FlagKeysUsed with the flags for each of the navigation keystrokes that the form or application can process or discard. Discarded keystrokes are keystrokes to which the sink does not respond but for which the sink will return S_FALSE, preventing other message handlers from having the opportunity to process the keystroke.

Only forms or applications that intercept arrow keystrokes or enter keystrokes need to process the WM_QUERYKEYUSAGE message.

The following code example shows how to use the WM_QUERYKEYUSAGE message and IQueryKeyUsage::FlagKeysUsed method.

if (WM_APCSYSMSG_QUERYKEYUSAGE == uMsg)
{
    IQueryKeyUsage *pqku = (IQueryKeyUsage*)lParam;

    // Return the result of FlagKeyUsed as the return value for 
    // the current method.
    return pqku->FlagKeysUsed((QKU_VK_LEFT | QKU_VK_RIGHT), (QKU_VK_UP | QKU_VK_DOWN));
}

See Also

WM_QUERYKEYUSAGE