I've been able to get Daryl Rictor's library PC Keyboard library
http://sbc.rictor.org/pckb6522.html to work with a full sized keyboard. But KBINIT hangs when I use an Adesso compact keyboard
https://www.amazon.com/Adesso-Keyboard-Embeddedd-Numberic-Keypad/dp/B00024ENUCI was able to narrow it down to the segment of code below. Specifically just after it attempts to set the LED's and check the acknowledgment. If I put an rts just after the jsr kbsend it doesn't hang, but it doesn't set the LED's properly either.
Code:
kbsled: lda #$ED ; Set the keybrd LED's from kbleds variable
jsr kbsend ;
jsr kbget ;
cmp #$FA ; ack?
bne kbsled ; resend led cmd
lda special ;
and #$07 ; ensure bits 3-7 are 0
jsr kbsend ;
rts ;
I don't know enough about the PS/2 keyboard protocol to understand why setting LED's would fail for a keyboard with a different layout.