User Tools

Site Tools


guides:keyboard

This is an old revision of the document!


Connecting a keyboard

In order to set up your keyboard for use in Folk you need to create a keyboard claim like this (taken from the folk0 instance):

Claim $this is a keyboard with path /dev/input/by-path/platform-i8042-serio-0-event-kbd

This page will walk you through creating your own keyboard claim for use in Folk.


In a virtual program paste this program:

Connnected
proc udevadm_properties {device} {
    return [exec udevadm info --query=property --name=$device]
}

proc is_keyboard {device} {
    set properties [udevadm_properties $device]
    if {$properties eq ""} {
    return false
    }
    # Check if device is a keyboard and not a mouse
    set isKeyboard [string match *ID_INPUT_KEYBOARD=1* $properties]
    set isMouse [string match *ID_INPUT_MOUSE=1* $properties]
    return [expr {$isKeyboard && !$isMouse}]
}

set result [exec ls /dev/input/by-path]
set keyboards [list]

foreach device $result {
    set fullDevice "/dev/input/by-path/$device"
    set keyboardCheck [is_keyboard $fullDevice]
    if {$keyboardCheck} {
    lappend keyboards $fullDevice
    }
}

Wish $this is outlined white
foreach kb $keyboards {
    Claim $this has keyboard path "$kb"
    Wish $this is labelled "$kb"
    puts "---\nKeyboard claim: Claim \$this is a keyboard with path $kb\n---\n"
}

When you hit save this will display the connected keyboard's path on the table:

list_keyboard_folk0.jpeg

and in the journal (make journal):

Nov 13 20:18:45 folk0 make[39865]: ---
Nov 13 20:18:45 folk0 make[39865]: Keyboard claim: Claim $this is a keyboard with path /dev/input/by-path/platform-i8042-serio-0-event-kbd
Nov 13 20:18:45 folk0 make[39865]: ---

Put this claim into a new virtual program and hit print. Tape this to the bottom of your keyboard and you now have a keyboard with an attached editor:

20231113-213631.jpeg

guides/keyboard.1699992892.txt.gz · Last modified: 2023/11/14 20:14 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki