in reply to Windows Tk issue Copy and Paste Russian keyboard

Code?

keyboard layout is an operating system concept, Tk knows nothing about it, it just gets keycodes

  • Comment on Re: Windows Tk issue Copy and Paste Russian keyboard

Replies are listed 'Best First'.
Re^2: Windows Tk issue Copy and Paste Russian keyboard
by IB2017 (Pilgrim) on May 20, 2019 at 07:43 UTC

    Hello Anonymous. No code this time, as Copy and Paste works in Tk out-of-the-box on Windows (and on macOS too), so I do not normally need to handle it specifically. I admit I do not know how it works behind the scenes (but I would like to get info about it). I just noted that it "simply works" on any layout I tried, except Russian (there may be others though). And my Russian users have told me that the standard shortkeys should be the usual ones (ctrl+C/V).

      How do you type Ctrl+C and Ctrl+V on a Russian keyboard? Are they Ctrl+Ц and Ctrl+В?

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

        I am a bit confused. In all applications I have tried (Browser for example) I can switch keyboard layout and use Ctrl-C/V (I mean the same physical keys, not the value mapped to it) and copy and paste continues to work (I have tried with Russian, Greek, Chinese and so on). In a Tk Widget, this is not true anymore (Russian and Greek do not work anymore). As far as my (Russian) colleagues have reported that Russian copy and paste should work on Windows using the same (physical) keys we are accustomed to.

        If things are like this and this is not a bug, doeas it mean I need to add a bind to map a particular shortcut to copy/paste? This will a) need me to know the current keyboard layout (as far as I know there is no way to get it programmatically) b) code a way to perform the copy/paste operation. This sounds like quite a lot of job to have copy and paste on other layouts then Latin keyboards. Am I overseeing something?

        The keyboards have both layouts printed on them (otherwise it's a pain to use: imagine trying to access Perlmonks while only being able to type Cyrillic), and you just press the keys corresponding to Latin C and V, no matter which keyboard layout is active. With the most popular Cyrillic layout (that is, ЙЦУКЕН, not phonetic ЯВЕРТЫ), C corresponds to С (U+0421 CYRILLIC CAPITAL LETTER ES) and V corresponds to М (U+041C CYRILLIC CAPITAL LETTER EM).