[terminal] fixed key input (fixes #324)
[power] fixed detection (fixes #322)