Skip to content

Commit

Permalink
Readme: Added a detailed description of the capabilities of getKey.
Browse files Browse the repository at this point in the history
  • Loading branch information
timlg07 committed Nov 17, 2020
1 parent 4fef0f9 commit 8cfb34a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
# getKey
Get the key code or the character by providing one of them or by user input.
A tiny C program to receive key presses as keycode and character. It can also convert between keycode and character by providing one of them as argument.

GetKey is perfect for the usage in Windows batch or cmd.

## Details
GetKey always gives you the keycode and the character as output:
- The character is directly written to the standard output stream (with no trailing linebreak added).
- The keycode is returned as exitcode. You can access it with `%errorlevel%` in cmd or batch.

You have 3 possible ways to specify which character you want to output:
- By default getKey waits for a keypress by the user and outputs this character. (no arguments required)
- If you provide a number as argument, it will get interpreted as ASCII-code and the corresponding character will get printed.
- If you provide a character as argument this character will be used. For strings the first character is used.

## Possible Usages
- Get the keycodes of a series of keys the user types in.
- Masked input: recieve the character that was typed, but show a different character like `*`.
- Print special characters. For example `getKey 219` prints `` and `getKey 7` plays the bell sound.
- Convert between character and keycode in order to run algorithms like encryption or hashing on the keycode.
- Store and process user input as series of keycodes to avoid trouble with special characters.

0 comments on commit 8cfb34a

Please sign in to comment.