xref: /minix3/minix/lib/libsys/fkey_ctl.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 #include "sysutil.h"
2 #include <string.h>
3 
4 /*===========================================================================*
5  *				fkey_ctl				     *
6  *===========================================================================*/
fkey_ctl(request,fkeys,sfkeys)7 int fkey_ctl(request, fkeys, sfkeys)
8 int request;				/* request to perform */
9 int *fkeys;				/* bit masks for F1-F12 keys */
10 int *sfkeys;				/* bit masks for Shift F1-F12 keys */
11 {
12 /* Send a message to the TTY server to request notifications for function
13  * key presses or to disable notifications. Enabling succeeds unless the key
14  * is already bound to another process. Disabling only succeeds if the key is
15  * bound to the current process.
16  */
17     message m;
18     int s;
19     memset(&m, 0, sizeof(m));
20     m.m_lsys_tty_fkey_ctl.request = request;
21     m.m_lsys_tty_fkey_ctl.fkeys = (fkeys) ? *fkeys : 0;
22     m.m_lsys_tty_fkey_ctl.sfkeys = (sfkeys) ? *sfkeys : 0;
23     s = _taskcall(TTY_PROC_NR, TTY_FKEY_CONTROL, &m);
24     if (fkeys) *fkeys = m.m_tty_lsys_fkey_ctl.fkeys;
25     if (sfkeys) *sfkeys = m.m_tty_lsys_fkey_ctl.sfkeys;
26     return(s);
27 }
28 
29 
30