changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/io/kbd.lisp

changeset 684: 29fe829a7ac3
child: ebe3315b7add
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 29 Sep 2024 00:31:24 -0400
permissions: -rw-r--r--
description: evdev and io/kbd
1 ;;; kbd.lisp --- Keyboard-based IO
2 
3 ;; Keyboard-like devices and input
4 
5 ;;; Commentary:
6 
7 ;; refs:
8 
9 ;; - https://www.kernel.org/doc/Documentation/input/event-codes.txt
10 
11 ;;; Code:
12 (in-package :io/kbd)
13 (load-xkbcommon)
14 
15 (deferror kbd-error () ())
16 
17 (defstruct keyboard path state compose-state)
18 
19 (defconstant +evdev-offset+ 8)
20 
21 (defun evdev-bit-is-set (array bit))
22 
23 (defun keyboard-device-p (path))
24  ;; (sb-posix:ioctl (fd path)
25 (defun make-keyboard-from-dev (dev keymap compose-table))
26 
27 (defun get-keyboards (keymap compose-table &optional (dir "/dev/input"))
28  (let ((devices (directory dir)))
29  (dolist (dev devices)
30  (let ((ret (make-keyboard-from-dev dev keymap compose-table)))
31  ret))))
32 
33 ;; (with-open-file (file "/dev/input/event4")
34 ;; (let ((fd (sb-sys:fd-stream-fd file))
35 ;; (evbits))))
36 
37