A simple way to get it working is to get the character before the carret with selectionStart:
input.value[input.selectionStart-1];
Adapting your code:
<input id="myInput" type='text' oninput="validate(this)" />
function validate(input) {
console.log(input.value[input.selectionStart - 1]);
}