#!/bin/sh
# BlackBerry KEY2 LE keyboard.
#
# The microphone key (the one with "0" printed on it) reports KEY_DICTATE
# (586). The vt keyboard only translates keycodes < 256, so the key never
# reaches the console keymap and alt+mic typed nothing. Move it to keycode 11
# (KEY_0) so us-key2.map can give alt+mic = 0.
#
# setkeycodes takes the scancode in hex and the keycode in decimal: 0x1d = 29.
# Guarded: scancode 29 is LeftCtrl on a normal AT keyboard, so this must only
# run on the phone.
if grep -q "STMPE keypad" /proc/bus/input/devices 2>/dev/null; then
	setkeycodes 1d 11 2>/dev/null
fi
loadkeys /usr/share/kbd/keymaps/us/us-key2.map 2>/dev/null
