actkbd/actkbd.scm.5

19 lines
1.3 KiB
Groff

.\" -*- mode: troff; coding: utf-8 -*-
.TH ACTKBD.SCM "1" "2024-02-28" "v1.0" "actkbd.scm"
.SH "NAME"
actkbd.scm \- Configuration file for actkbd
.SH "DESCRIPTION"
\fBactkbd.scm\fR is a Guile Scheme script. It is executed in actkbd's initialization phase, and re-executed on every received SIGHUP signal.
.SH "ADDITIONAL SCHEME FUNCTIONS"
(bind\ KEYCODE\ FUNCTION) Binds a function to a key.
.PP
\fIKEYCODE\fR is an unsigned number less than \fBKEY_CNT\fR. \fBKEY_CNT\fR is platform-dependent: on \fILinux\fR, it is \fB768 (0x300)\fR. For keycodes: on \fILinux\fR, consult \fBinput\-event\-codes.h\fR or run actkbd in verbose mode to report key presses.
.PP
\fIFUNCTION\fR must accept one parameter, \fIEVENT_TYPE\fR. \fIEVENT_TYPE\fR contains event type that makes it possible to run a different action based on whether the key is pressed, released, or is held. \fBbind\fR protects the \fIFUNCTION\fR from being collected by the GC.
.PP
(led\ LED\ STATE) Sets a led to \fION\fR or \fIOFF\fR
.PP
\fILED\fR is an unsigned number less than \fBLED_CNT\fR. \fBLED_CNT\fR is platform-dependent: on \fILinux\fR, it is \fB16 (0x10)\fR.
.PP
\fISTATE\fR is a boolean, \fB#t\fR corresponds to \fION\fR state, and \fB#f\fR to \fIOFF\fR. Does nothing if the specified led is already in the specified state.