Added key-pressed/released mechanism in sample