~ubuntu-branches/ubuntu/saucy/amiwm/saucy

« back to all changes in this revision

Viewing changes to libami/kbdsupport.c

  • Committer: Bazaar Package Importer
  • Author(s): Jorgen Schaefer
  • Date: 2001-08-31 13:23:27 UTC
  • Revision ID: james.westby@ubuntu.com-20010831132327-n08nr7qqfhcgpsqp
Tags: upstream-0.20.48
ImportĀ upstreamĀ versionĀ 0.20.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <X11/Xlib.h>
 
2
#include <X11/keysym.h>
 
3
#include <stdlib.h>
 
4
#include <string.h>
 
5
#include "libami.h"
 
6
#include "module.h"
 
7
 
 
8
 
 
9
int md_grabkey(int keycode, unsigned int modifiers)
 
10
{
 
11
  int pkt[2], res=-1;
 
12
  char *ptr=NULL;
 
13
  pkt[0]=keycode; pkt[1]=modifiers;
 
14
  if(md_command(None, MCMD_ADD_KEYGRAB, pkt, sizeof(pkt), &ptr)>=sizeof(int))
 
15
    res=*((int*)ptr);
 
16
  if(ptr) free(ptr);
 
17
  return res;
 
18
}
 
19
 
 
20
int md_ungrabkey(int id)
 
21
{
 
22
  return md_command0(None, MCMD_DEL_KEYGRAB, &id, sizeof(id));
 
23
}