mirror of
https://github.com/amiwm/amiwm.git
synced 2026-04-14 11:04:18 +00:00
Initial commit!
This commit is contained in:
23
libami/kbdsupport.c
Normal file
23
libami/kbdsupport.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "libami.h"
|
||||
#include "module.h"
|
||||
|
||||
|
||||
int md_grabkey(int keycode, unsigned int modifiers)
|
||||
{
|
||||
int pkt[2], res=-1;
|
||||
char *ptr=NULL;
|
||||
pkt[0]=keycode; pkt[1]=modifiers;
|
||||
if(md_command(None, MCMD_ADD_KEYGRAB, pkt, sizeof(pkt), &ptr)>=sizeof(int))
|
||||
res=*((int*)ptr);
|
||||
if(ptr) free(ptr);
|
||||
return res;
|
||||
}
|
||||
|
||||
int md_ungrabkey(int id)
|
||||
{
|
||||
return md_command0(None, MCMD_DEL_KEYGRAB, &id, sizeof(id));
|
||||
}
|
||||
Reference in New Issue
Block a user