summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2021-12-22 17:41:59 +0100
committerPhilipp Gesang <phg@phi-gamma.net>2021-12-22 17:41:59 +0100
commitbb6e409e3a5f8d1b2d92eb7c5a3c4de73ea42985 (patch)
tree04c7ecc671232000bc29ad7f859de4b19ca46a4b
parent3bb3213576933dc1f43f5ed6f933cc7a8030014b (diff)
downloadvtcol-bb6e409e3a5f8d1b2d92eb7c5a3c4de73ea42985.tar.gz
expand docs to cover “kb {leds,flags}” split
-rw-r--r--README.rst12
-rw-r--r--doc/vtcol.rst25
-rw-r--r--src/lib.rs4
3 files changed, 35 insertions, 6 deletions
diff --git a/README.rst b/README.rst
index 79f7cac..2631ac8 100644
--- a/README.rst
+++ b/README.rst
@@ -79,12 +79,14 @@ This will print the color definitions contained in the scheme; if the specified
name does not resolve to a pre-defined scheme it will be interpreted as a file
name instead.
-Keyboard LEDs
+Keyboard LEDs and flags
-------------------------------------------------------------------------------
+Keyboard handling is grouped under the ``vtcol kb`` subcommand.
+
Show the current state of the keyboard LEDs: ::
- $ vtcol leds get
+ $ vtcol kb leds get
caps: false, num: true, scroll: false
Set the state of the Caps Lock LED (does *not* affect the Caps Lock state, just
@@ -92,6 +94,12 @@ the LED itself): ::
$ vtcol leds set --caps on
+Likewise for the keyboad state (*not* the LEDs): ::
+
+ $ vtcol kb flags get
+ [flags: caps: false, num: false, scroll: false; default: caps: false, num: false, scroll: false]
+
+
Building
-------------------------------------------------------------------------------
diff --git a/doc/vtcol.rst b/doc/vtcol.rst
index e601fdd..7166c72 100644
--- a/doc/vtcol.rst
+++ b/doc/vtcol.rst
@@ -36,9 +36,9 @@ they operate on:
Inspect and manipulate the console palette.
-**leds**
+**kb**
- Keyboad LED state.
+ Keyboard manipulation (LEds, modifiers).
vtcol colors commands
#####################
@@ -100,8 +100,8 @@ vtcol colors commands
$ vtcol colors fade --ms 1337 --from solarized --to solarized_light
-vtcol leds commands
-###################
+vtcol kb leds commands
+######################
**get**
@@ -122,6 +122,23 @@ vtcol leds commands
$ vtcol leds set --revert
+vtcol kb flags commands
+######################
+
+**get**
+
+ Get the current keyboard flags. Example: ::
+
+ $ vtcol -C /dev/tty6 kb flags get
+ [flags: caps: false, num: false, scroll: false; default: caps: false, num: false, scroll: false]
+
+**set**
+
+ Set the state of individual keyboard LEDs: ::
+
+ $ vtcol flags set --caps on --num off
+
+
global options
-------------------------------------------------------------------------------
diff --git a/src/lib.rs b/src/lib.rs
index 5cf62c1..374b518 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -194,6 +194,8 @@ pub mod ioctl
.map(|_| ())
}
+ /* This should perhaps return unit as the kernel supposedly always returns
+ the constant ``KB_101``. */
pub fn kdgkbtype<F: AsRawFd>(fd: &F) -> Result<libc::c_char>
{
let mut kb: libc::c_char = 0;
@@ -202,6 +204,8 @@ pub mod ioctl
ioctl(fd.as_raw_fd(), KDGKBTYPE, &mut kb as *mut _)
})?;
+ //assert_eq(kb, KB_101); /* XXX */
+
Ok(kb)
}
}