@mustang7757 : Yes, tried but no use. I even tried factory reset my phone, and the issue is still there. I am on Huawei P20 Pro btw. And it seems this issue only occur when i am charging the phone. And if I were to disconnect it from the charging cable, the keyboard would be functioning as normal.
@BergerKing : I don't have that issue though. My issue is when i type a word, it will just output a string of random chars, and if i were to keep pressing and hold on the backspace key... it would be an endless supply of random strings.