subcalls.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
KbdFreeFocus (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_KBD
 
USHORT KbdFreeFocus(hkbd)
HKBD hkbd;    /* keyboard handle */
 
The KbdFreeFocus function frees the focus from the specified logical
keyboard. Other logical keyboards can then use the focus.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hkbd       Identifies the logical keyboard that loses the focus. The handle
           must have been created previously by using the KbdOpen function.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_KBD_DETACHED
     ERROR_KBD_INVALID_HANDLE
     ERROR_KBD_FOCUS_REQUIRED
Comments
 
If a process has been waiting for the focus as a result of calling the
KbdGetFocus function, MS OS/2 assigns the focus to the logical keyboard as
soon as it is free. If more than one process is waiting, MS OS/2 chooses a
logical keyboard and assigns the focus. The other processes continue to wait
until the focus is free.
 
Example
 
This example frees a logical keyboard: if other logical keyboards have been
waiting, MS OS/2 assigns the focus to one of them; if no other logical
keyboards have been waiting, MS OS/2 uses the default keyboard:
 
HKBD hkbd;
KbdOpen(&hkbd);
KbdGetFocus(IO_WAIT, hkbd);    /* gets focus  */
    .
    .
    .
KbdFreeFocus(hkbd);            /* frees focus */
 
See Also
 
KbdGetFocus, KbdOpen