How to stimulate press the Windows key using “keyboard.press(); - python-3.x

I'm trying to stimulate the windows key button using pynput but cant find any answers in the pynput documentation

Try Key.cmd:
"A generic command button. On PC platforms, this corresponds to the Super key or Windows key, and on Mac it corresponds to the Command key. This may be a modifier."
Source

Related

Tkinter vs Linux (ubuntu/Mint) <KP_Enter> not enabled by default

On Windows the events of the 'Return' key by default are already linked to the <KP_Enter> key. For example selecting a combobox item, or closing a mesagebox
Here I use Linux Mint x64 Cinnamon 20.2, based on Ubuntu. And the <KP_Enter> key is not linked to the events of the 'Return' key. Is this a bug? Or I need to do some configuration.
example if I try to select an item from the combobox with Enter, it works. But if I press <KP_Enter> (numeric enter) nothing happens
If this is a bug, where can I report it?
Key Pad Enter (KP_Enter) does not work on Ubuntu. Let me know if you find an alternative.
This is the archived list of predefined events and it is listed. Again, if there is an alternative let us know.
https://web.archive.org/web/20190512164300id_/http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/event-types.html
from my knowledge of free pascal programming
in windows : Enter(or return key) is mapped to one key VK_RETURN
in Linux : Enter is mapped to 2 keys
for keypad(numeric) to XK_KP_Enter
for left return XK_RETURN

Incorrect Keymapping on Pi400

I have loaded the latest version of Raspberry Pi OS (32-bit) to a pi400, but the keymapping is odd. For instance, my backslash '\' Key types the pound sign '#'. Other keys are also mapped oddly too.
I first checked the keyboard-mapping via
sudo raspi-config
and then from the prompt selected Localization Options > Keyboard > Configuring keyboard-configuration
For Keyboard Model, I selected 'Generic 101-key PC' as per this pihut article suggestion.
I saved and rebooted; no luck.
I found a tutorial on remapping keys, but requires some bash scripting to run on start, which seems messy.
Maybe choosing a different Keyboard model in keyboard-configuration would solve the issue instead?
Turns out my locale was set to UK.
I used the following command to change my keyboard region and it fixed the issue
setxkbmap us

VS Code not responding properly to keyboard switch in Linux Mint?

In my Linux Mint OS, I have switched the ESC key with the CAPS key. I know that the switch has been made because it works properly for every other application. However, when it comes to VS Code, in particular, I still need to press the ESC key in order to escape from auto complete suggestions.

arrow key behaves abnormally on linux?

I connect to the remote Linux (desktop version) via ssh on my laptop. When the firefox with GUI (or other softwares) is opened, the arrow keys are out of work. Specifically, when the up arrow is pressed, the effect is equal to '8' is pressed and held.
It's solved via switching the input method from chinese to english.

Ins key on a mac keyboard in Linux

I am on a Linux (fluxbox/Mint) with urxvt using an external Mac keyboard. I can't find an ins key. In urxvt you can select a part of text, it automatically copies, and with other types of keyboards I could use Shift+Insert and it pastes the text. How can I paste the text with a mac keyboard running in a Linux? Needless to say, that I tried the standard variations of Ctrl+C and Ctrl+V, Ctrl+0, Shift+0, in combination with fn key.
Try Fn+Shift+return.
This works as middle-click paste under both Gnome (Wayland) and i3wm (Xorg) in Fedora 28 with my 2016 MacBook Pro 13,1 built-in keyboard (using an out-of-tree SPI driver). Hopefully it's the same situation for external Mac keyboards under other specific environments.
Maybe you can try fn + return to simulate the Insert key.
Another way, install AutoKey :
apt-get install autokey-gtk
and set a phrase to:
Phrase Text: <ctrl>+C (actually type out the <ctrl>+ here)
Paste Using: Keyboard
Abbreviation: None
Hotkey: <super>+v
Window Filter: None
If you want to use your Apple keyboard like a regular US-layout keyboard, with Alt on the left side of Meta, you can use the AUR package un-apple-keyboard. Currently it only works for the aluminium USB model.
The package does the following things:
Adds a /etc/modprobe.d/hid_apple.conf file which enables the F num keys by default, as in #Function keys do not work.
Uses keyfuzz to remap F13-15 to PrintScreen/SysRq, Scroll Lock, and Pause, respectively.
Swaps the ordering of the Alt and Meta (Command) keys to match all other keyboards, again using /etc/modprobe.d/hid_apple.conf, as in #Swap the Alt key and Command key (Meta/Super).
Applies these changes automatically when you plug in your keyboard, with a udev rule.
See more information from Archlinux wiki Apple Keyboard.
Try Fn+Opt+Return. Works for me.

Resources