diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2021-12-22 17:41:59 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2021-12-22 17:41:59 +0100 |
commit | bb6e409e3a5f8d1b2d92eb7c5a3c4de73ea42985 (patch) | |
tree | 04c7ecc671232000bc29ad7f859de4b19ca46a4b | |
parent | 3bb3213576933dc1f43f5ed6f933cc7a8030014b (diff) | |
download | vtcol-bb6e409e3a5f8d1b2d92eb7c5a3c4de73ea42985.tar.gz |
expand docs to cover “kb {leds,flags}” split
-rw-r--r-- | README.rst | 12 | ||||
-rw-r--r-- | doc/vtcol.rst | 25 | ||||
-rw-r--r-- | src/lib.rs | 4 |
3 files changed, 35 insertions, 6 deletions
@@ -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 ------------------------------------------------------------------------------- @@ -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) } } |