Not tested. This code is based in this other one as timdream suggested: https://github.com/alivedise/gaia/blob/9058317544abe7b4759c6535e1471c65ed9ef71f/apps/communications/dialer/js/keypad.js#L281-L286