Skip to content

Instantly share code, notes, and snippets.

View anasouardini's full-sized avatar
👽

Ouardini Anas anasouardini

👽
View GitHub Profile
#!/bin/sh
key_input() {
local key
IFS= read -rsn1 key 2>/dev/null >&2
if [[ $key = "" ]]; then echo enter; fi;
if [[ $key = $'\x20' ]]; then echo space; fi;
if [[ $key = "k" ]]; then echo up; fi;
if [[ $key = "j" ]]; then echo down; fi;
if [[ $key = $'\x1b' ]]; then