From 9e4eef8873aba282e704b2ba00b508ec8fcda38a Mon Sep 17 00:00:00 2001
From: Mario Lenz <m@riolenz.de>
Date: Sun, 7 Jan 2024 18:32:19 +0100
Subject: [PATCH 1/2] vmware_guest_sendkey: Add Windows key

---
 changelogs/fragments/1959-vmware_guest_sendkey.yml | 2 ++
 plugins/modules/vmware_guest_sendkey.py            | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 changelogs/fragments/1959-vmware_guest_sendkey.yml

diff --git a/changelogs/fragments/1959-vmware_guest_sendkey.yml b/changelogs/fragments/1959-vmware_guest_sendkey.yml
new file mode 100644
index 0000000000..720f9a7a17
--- /dev/null
+++ b/changelogs/fragments/1959-vmware_guest_sendkey.yml
@@ -0,0 +1,2 @@
+minor_changes:
+  - vmware_guest_sendkey - Add Windows key (https://github.com/ansible-collections/community.vmware/issues/1959).
diff --git a/plugins/modules/vmware_guest_sendkey.py b/plugins/modules/vmware_guest_sendkey.py
index 17b4fcbc09..17fe0f5da1 100644
--- a/plugins/modules/vmware_guest_sendkey.py
+++ b/plugins/modules/vmware_guest_sendkey.py
@@ -77,7 +77,7 @@
      description:
      - The list of the keys will be sent to the virtual machine.
      - 'Valid values are C(ENTER), C(ESC), C(BACKSPACE), C(TAB), C(SPACE), C(CAPSLOCK), C(HOME), C(DELETE), C(END), C(CTRL_ALT_DEL),
-        C(CTRL_C), C(CTRL_X) and C(F1) to C(F12), C(RIGHTARROW), C(LEFTARROW), C(DOWNARROW), C(UPARROW).'
+        C(CTRL_C), C(CTRL_X) and C(F1) to C(F12), C(RIGHTARROW), C(LEFTARROW), C(DOWNARROW), C(UPARROW), C(WINDOWS).'
      - If both O(keys_send) and O(string_send) are specified, keys in O(keys_send) list will be sent in front of the O(string_send).
      type: list
      default: []
@@ -249,6 +249,7 @@ def __init__(self, module):
             ('LEFTARROW', '0x50', [('', [])]),
             ('DOWNARROW', '0x51', [('', [])]),
             ('UPARROW', '0x52', [('', [])]),
+            ('WINDOWS', '0x65', [('', [])]),
         ]
 
     @staticmethod

From 1baa002a33300d8da07457c2184e9fba046edb35 Mon Sep 17 00:00:00 2001
From: Mario Lenz <m@riolenz.de>
Date: Tue, 9 Jan 2024 18:35:29 +0100
Subject: [PATCH 2/2] Fix Windows key code

---
 plugins/modules/vmware_guest_sendkey.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/modules/vmware_guest_sendkey.py b/plugins/modules/vmware_guest_sendkey.py
index 17fe0f5da1..8d1c56cff7 100644
--- a/plugins/modules/vmware_guest_sendkey.py
+++ b/plugins/modules/vmware_guest_sendkey.py
@@ -249,7 +249,7 @@ def __init__(self, module):
             ('LEFTARROW', '0x50', [('', [])]),
             ('DOWNARROW', '0x51', [('', [])]),
             ('UPARROW', '0x52', [('', [])]),
-            ('WINDOWS', '0x65', [('', [])]),
+            ('WINDOWS', '0xe3', [('', [])]),
         ]
 
     @staticmethod