Using an Italian Windows keyboard in remote management of iMac I'm using TeamViewer on a Windows computer to control an iMac. The keyboard on my side is this, but I set it so that it works like this one (when I push \ I obtain `, when I push Shift\ I get ~, and so on).

At the beginning I thought it was unavoidable, so I started to get used to these changes (hard to do, since I write in LaTeX and the backslash is the most important non alphabetical character). Accidentally I changed the settings such that the keyboard is mapped in the right way, but I don't know how. So far, it's fine; then I unfortunately (and accidentally) turned things back, so I think it's the moment to understand how to manage this settings.

In System Preferences > Keyboard I see there's only the Italian keyboard. Furthermore, even if I add and select other keyboards, I always get ~ when I press Shift-\ (the original behavior).

Could the problem concern being connected remotely?
It was not a problem concerning TeamViewer, nor the preferences/settings of the Mac. Evidently I accidentally pressed Alt-Shift, thus changing the keyboard input method in Windows from Ita to Eng. I realized this by simply visualizing the keyboard on screen and watching it change depending on which window was active.