numlock.h 948 B

123456789101112131415161718192021222324252627282930313233
  1. /* SLiM - Simple Login Manager
  2. Copyright (C) 2004-06 Simone Rota <sip@varlock.com>
  3. Copyright (C) 2004-06 Johannes Winkelmann <jw@tks6.net>
  4. Copyright (C) 2012 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. */
  10. #ifndef _NUMLOCK_H_
  11. #define _NUMLOCK_H_
  12. #include <X11/Xlib.h>
  13. #include <X11/XKBlib.h>
  14. #include <X11/keysym.h>
  15. class NumLock {
  16. public:
  17. NumLock();
  18. static void setOn(Display *dpy);
  19. static void setOff(Display *dpy);
  20. private:
  21. static int xkb_init(Display* dpy);
  22. static unsigned int xkb_mask_modifier( XkbDescPtr xkb, const char *name );
  23. static unsigned int xkb_numlock_mask(Display* dpy);
  24. static void control_numlock(Display *dpy, bool flag);
  25. };
  26. #endif