I have the same issue on version 3.22 and it related to the get_keycode_state() function.
Keyocde state is "0" when I type manually but "128" when I paste the same key. The thing is the Mod5() constant from X11::Protocol::Constants which is 128. Here is the part of the code where it sets "state=128" and creates the whole mess: 505 SWITCH: for ($state) { 506 /^n$/ && do { 507 $state = 0; 508 last SWITCH; 509 }; 510 /^s$/ && do { 511 $state = Shift(); 512 last SWITCH; 513 }; 514 /^a$/ && do { * 515 $state = Mod5();* 516 last SWITCH; 517 }; 518 /^sa$/ && do { * 519 $state = Shift() + Mod5();* 520 last SWITCH; 521 }; I patched it to remove the Mod5() call and now I can paste perfectly. This is probably not the best solution but it works for me. 505 SWITCH: for ($state) { 506 /^n$/ && do { 507 $state = 0; 508 last SWITCH; 509 }; 510 /^s$/ && do { 511 $state = Shift(); 512 last SWITCH; 513 }; 514 /^a$/ && do { * 515 $state = 0;* 516 last SWITCH; 517 }; 518 /^sa$/ && do { * 519 $state = Shift();* 520 last SWITCH; 521 }; -- "Judge me by my size, do you? And well you should not" Master Yoda