Kestroke Metrics

Introduction

Keystroke dyanmics is the study of the unique timing patterns in an indiviual’s typing, and typically includes extracting keystroke timing features such as the duration of a key press and the time elapsed between key presses.[Epp et al., 2011]

This metrics (or dyanmics) obtained from keyboard interaction have been widely used in various applications, including user authentication, behavioral biometrics, affective computing, and human-computer interaction studies. [Khan et al., 2008, Epp et al., 2011, Khanna and Sasikumar, 2010, Vizer et al., 2009, Nahin et al., 2014, Dijkstra, 2013]

There is not much research on the use of keystroke dynamics and behavioral user patterns. In [Katerina and Nicolaos, 2018] the authors explore the use of keystroke dynamics in correlation with end-user’s behavior attributes during web-based EUD activities, revealing that this metrics reflect some correlatinons with perceieved usefulness or self-efficacy.

Keyboard events

Keyboard events are signals generated by computers or devices when a user interacts with a keyboard,, which are mainly used to capture user input. A keyboard event typically consists of two main actions: key press (key down) and key release (key up).

Each event contains information realted to the specific key involved, such as the key code, character representation, and any modifier keys (e.g., Shift, Ctrl, Alt) that may be active during the event.

For more information on keyboard events, check the Keyboard Events documentation in Windows, Mozilla or Unity.

Typing Duration

When users type on a keyboard, each keystroke involves a key press followed by a key release. The typing duration metric captures the time interval between these two events for each keystroke. This metric is useful for analyzing typing speed or patterns. [Katerina and Nicolaos, 2018, Khanna and Sasikumar, 2010]. The function typing_durations() computes the typing durations from a DataFrame containing keyboard interaction data. The DataFrame should include columns for event type (key press or key release), timestamps, and keys (session or user identifiers).

Tpying Speed

This metric refers to the average number of characters typed per minute (CPM) by a user during a typing session. It provides insights into the user’s typing proficiency, ease of use or emotional state [Katerina and Nicolaos, 2018, Khanna and Sasikumar, 2010]. The function typing_speed() calculates the average typing speed from a DataFrame containing keyboard interaction data. The DataFrame should include columns for event type (key press or key release), timestamps, and keys (session or user identifiers). With the function typing_speed_metrics() the metrics returned include: average CPM, total characters typed, and total time spent typing.

Backspace Usage

The number of times a user presses the backspace key during a typing session can be a helpful metric to assess a negative emotional state and error correction behavior [Khanna and Sasikumar, 2010]. The function backspace_usage() computes the backspace usage from a DataFrame containing keyboard interaction data. The DataFrame should include columns for event type (key press or key release), timestamps, and keys (session or user identifiers).

References

[1] (1,2,3)

Tzafilkou Katerina and Protogeros Nicolaos. Mouse behavioral patterns and keystroke dynamics in End-User development: what can they tell us about users' behavioral attributes? Comput. Human Behav., 83:288–305, June 2018. URL: https://doi.org/10.1016/j.chb.2018.02.012.

[2]

Iftikhar Ahmed Khan, Willem-Paul Brinkman, Nick Fine, and Robert M Hierons. Measuring personality from keyboard and mouse use. In Proceedings of the 15th European conference on Cognitive ergonomics: the ergonomics of cool interaction. New York, NY, USA, January 2008. ACM.

[3]

Jungwook Rhim, Jiwon Kim, and Gahgene Gweon. Using geometric features of drag-and-drop trajectories to understand students' learning. In Proceedings of the 2023 CHI Conference on Human Factors in Computing Systems, volume 19, 1–14. New York, NY, USA, April 2023. ACM. URL: https://dl.acm.org/doi/10.1145/3544548.3581143.

[4]

Masud Karim and Md Hasanuzzaman. A study on mouse movement features to identify user. Sci. Res. J., 08(04):77–82, April 2020.

[5]

Dirk U Wulff, Pascal J Kieslich, Felix Henninger, Jonas M B Haslbeck, and Michael Schulte-Mecklenbeck. Movement tracking of psychological processes: a tutorial using mousetrap. Behav. Res. Methods, 57(11):307, October 2025.

[6]

Martin Schoemann, Malte Lüken, Tobias Grage, Pascal J Kieslich, and Stefan Scherbaum. Validating mouse-tracking: how design factors influence action dynamics in intertemporal decision making. Behav. Res. Methods, 51(5):2356–2377, October 2019.

[7]

Eduard Kuric, Peter Demcak, Matus Krajcovic, and Peter Nemcek. Is mouse dynamics information credible for user behavior research? an empirical investigation. Comput. Stand. Interfaces, 90(103849):103849, August 2024.

[8]

Pascal J. Kieslich, Felix Henninger, Dirk U. Wulff, Jonas M. B. Haslbeck, and Michael Schulte-Mecklenbeck. Mouse-tracking: a practical guide to implementation and analysis. In A Handbook of Process Tracing Methods, pages 20. Routledge, 2nd edition edition, 2019. URL: https://www.taylorfrancis.com/chapters/edit/10.4324/9781315160559-9/mouse-tracking-pascal-kieslich-felix-henninger-dirk-wulff-jonas-haslbeck-michael-schulte-mecklenbeck.

[9]

Christian O'Reilly and Réjean Plamondon. Can computer mice be used as low-cost devices for the acquisition of planar human movement velocity signals? Behav. Res. Methods, 43(1):229–238, March 2011. URL: https://link.springer.com/article/10.3758/s13428-010-0030-3#notes.

[10]

Adriana Seelye, Stuart Hagler, Nora Mattek, Diane B Howieson, Katherine Wild, Hiroko H Dodge, and Jeffrey A Kaye. Computer mouse movement patterns: a potential marker of mild cognitive impairment. Alzheimers Dement. (Amst.), 1(4):472–480, December 2015. URL: https://alz-journals.onlinelibrary.wiley.com/doi/10.1016/j.dadm.2015.09.006.

[11]

Beatriz Pariente-Martinez, Martin Gonzalez-Rodriguez, Daniel Fernandez-Lanvin, and Javier De Andres-Suarez. Measuring the role of age in user performance during interaction with computers. Univers. Access Inf. Soc., 15(2):237–247, June 2016. URL: https://link.springer.com/article/10.1007/s10209-014-0388-6.

[12] (1,2)

Clayton Epp, Michael Lippold, and Regan L Mandryk. Identifying emotional states using keystroke dynamics. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems. New York, NY, USA, May 2011. ACM.

[13] (1,2,3,4)

Preeti Khanna and M Sasikumar. Recognising emotions from keyboard stroke pattern. Int. J. Comput. Appl., 11(9):1–5, December 2010.

[14]

Lisa M Vizer, Lina Zhou, and Andrew Sears. Automated stress detection using keystroke and linguistic features: an exploratory study. Int. J. Hum. Comput. Stud., 67(10):870–886, October 2009.

[15]

A F M Nazmul Haque Nahin, Jawad Mohammad Alam, Hasan Mahmud, and Kamrul Hasan. Identifying emotion by keystroke dynamics and text pattern analysis. Behav. Inf. Technol., 33(9):987–996, September 2014.

[16]

Maarten Dijkstra. The diagnosis of self-efficacy using mouse and keyboard input. PhD thesis, Utrecht University, 2013.