Skip to content

agmaengine/kbana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kbana

keyboard keystroke recorder and analysis packages, the keystroke recorder related classes and functions are collected in capture module, analysis tools are collected in analysis module. Currently, the analysis module has only visualization of keystroke on keyboard and finger load.

Installation

PYPI
pip install kbana

from git repository
git clone https://github.com/agmaengine/kbana.git
pip install .

kbana.capture

Recorder(filename=None, directory=None)

if recording file is exists then increment the existing recording
if recording file is not exists then creating new recording file when save_recording is called
if recording file is provided directory is ignored
if directory is provided create directory if not exists. When save_recording is called, Recorder saves recording
with timestamps, when the Recorder is constructed, to the directory.
if none is provided, create records directory in the directory where the module is called.
When save_recording is called, Recorder saves recording with timestamps, when the Recorder is constructed,
to the directory.

filename (str): path to recording file (default: None)
directory (str): path to recording directory (default: None)

kbana.capture.Recorder.record()
record a single keystroke

kbana.capture.Recorder.record_built_in()
continuously record keystrokes, stop when pressing esc

kbana.capture.Recorder.save_recording(filename=None)
if filename is provided save recording to the filename, otherwise the behavior determined when Recorder is constructed filename (str): recording save file name

kbana.capture.Recorder.recording
return copy of recording

kbana.capture.Recorder.filename
return copy of filename

kbana.analysis

kbana.analysis.visualize_key_stroke(recording, keyboard_style=None, keyboard_offset=(0, 0), exclude_key_list=[], axis_handle=plt, numeric='freq', log_scale=False)

visualize keystroke on keyboard

keyboard_style options

  • 'MainType/blank'
  • 'MainType/Thai_Pattachoat_shift'
  • 'MainType/Thai_Pattachoat_no_shift'

numeric options

  • 'prop': proportion
  • 'percent': percent
  • 'freq': frequency

kbana.analysis.visualize_finger_load(recording, axis_handle=plt, numeric='freq', exclude_shift=True)

visualize finger load

numeric options

  • 'prop': proportion
  • 'percent': percent
  • 'freq': frequency

kbana.analysis.simulate_recording(text, layout)

text (str)

simulate recording from input text

layout options

  • English
    • 'qwerty'
  • Thai
    • 'kedmanee'
    • 'pattachoat'

kbana.analysis.load_words_from_file(path_to_file, allow_duplicate=False)

read list of word from text file. if words are separated by space, remove duplicated word.

return text (str)

Add more keyboard styles

add your style directory in kbana/analysis/keyboard_styles file structure should be

analysis/keyboard_styles /keyboard_conifuration /keyboard_layout

in keyboard_layout includes your keyboard image (PNG format is preferred) and key_plot_map.json the detail is in kbana/analysis/keyboard_styles/key_plot_map_meta.txt

About

keyboard key stroke recording and analysis

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages