added key detection from chingu examples