working window resizing
pattern-matching based key input