Repository: pwr-Solaar/Solaar

Issue:
Logi Pop Keys emoji keys not supported
**Information**
<!-- Make sure that your issue is not one of the known issues in the Solaar documentation at https://pwr-solaar.github.io/Solaar/ -->
<!-- Do not bother opening an issue for a version older than 1.0.6.  Please update to the latest version and see if your issue persists. -->
- Solaar version 1.1.0
- Distribution:
- Kernel version 5.15.7.arch1
- Output of `solaar show`:

<details>

```
Bolt Receiver
  Device path  : /dev/hidraw2
  USB id       : 046d:C548
  Serial       : 43353536463033374537393838313845
  Has 2 paired device(s) out of a maximum of 6.
  Notifications: wireless, software present (0x000900)
  Device activity counters: 1=154, 2=102

  1: Logi POP Keys
     Device path  : None
     WPID         : B365
     Codename     : Logi POP Keys
     Kind         : keyboard
     Protocol     : HID++ 4.5
     Serial number: F0C214D3
     Model ID:      B36500000000
     Unit ID:       F0C214D3
        Bootloader: BL1 44.00.B0005
          Firmware: RBK 69.00.B0005
             Other: 
     The power switch is located on the (unknown).
     Supports 31 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
            Firmware: Bootloader BL1 44.00.B0005 B36567A459DC01
            Firmware: Firmware RBK 69.00.B0005 B36567A459DC01
            Firmware: Other   
            Unit ID: F0C214D3  Model ID: B36500000000  Transport IDs: {'btleid': 'B365'}
         3: DEVICE NAME            {0005}   
            Name: Logi POP Keys
            Kind: keyboard
         4: WIRELESS DEVICE STATUS {1D4B}   
         5: RESET                  {0020}   
         6: DEVICE FRIENDLY NAME   {0007}   
            Friendly Name: Logi POP Keys
         7: UNIFIED BATTERY        {1004}   
         8: REPROG CONTROLS V4     {1B04}   
         9: CHANGE HOST            {1814}   
            更改主機號碼        : 1:cjslappy
        10: HOSTS INFO             {1815}   
            Host 0 (paired): cjslappy
            Host 1 (unpaired): 
            Host 2 (unpaired): 
        11: K375S FN INVERSION     {40A3}   
            互換 Fx 鍵功能 (saved): False
            互換 Fx 鍵功能        : False
        12: LOCK KEY STATE         {4220}   
        13: KEYBOARD DISABLE KEYS  {4521}   
            Disable keys (saved): {'1': False, '16': False, '8': False}
            Disable keys        : {'1': False, '8': False, '16': False}
        14: MULTIPLATFORM          {4531}   
            Set OS (saved): 0
            Set OS        : Windows
        15: KEYBOARD LAYOUT 2      {4540}   
        16: unknown:00C3           {00C3}   
        17: DEVICE RESET           {1802}   internal, hidden, unknown:000010
        18: unknown:1803           {1803}   internal, hidden, unknown:000010
        19: CONFIG DEVICE PROPS    {1806}   internal, hidden, unknown:000010
        20: unknown:1816           {1816}   internal, hidden, unknown:000010
        21: OOBSTATE               {1805}   internal, hidden
        22: unknown:1830           {1830}   internal, hidden, unknown:000010
        23: unknown:1891           {1891}   internal, hidden, unknown:000008
        24: unknown:18A1           {18A1}   internal, hidden, unknown:000010
        25: unknown:1E00           {1E00}   hidden
        26: unknown:1E02           {1E02}   internal, hidden
        27: unknown:1602           {1602}   
        28: unknown:1EB0           {1EB0}   internal, hidden, unknown:000010
        29: unknown:1861           {1861}   internal, hidden, unknown:000010
        30: unknown:18B0           {18B0}   internal, hidden, unknown:000010
     Has 20 reprogrammable keys:
         0: Host Switch Channel 1     , default: HostSwitch Channel 1        => HostSwitch Channel 1      
             is FN, FN sensitive, analytics key events, pos:1, group:0, group mask:empty
             reporting: default
         1: Host Switch Channel 2     , default: HostSwitch Channel 2        => HostSwitch Channel 2      
             is FN, FN sensitive, analytics key events, pos:2, group:0, group mask:empty
             reporting: default
         2: Host Switch Channel 3     , default: HostSwitch Channel 3        => HostSwitch Channel 3      
             is FN, FN sensitive, analytics key events, pos:3, group:0, group mask:empty
             reporting: default
         3: Show Desktop              , default: Show Desktop                => Show Desktop              
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:4, group:0, group mask:empty
             reporting: default
         4: unknown:010A              , default: unknown:00DF                => unknown:00DF              
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:5, group:0, group mask:empty
             reporting: default
         5: unknown:011C              , default: unknown:00F1                => unknown:00F1              
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:6, group:0, group mask:empty
             reporting: default
         6: Previous Fn               , default: Previous                    => Previous                  
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:7, group:0, group mask:empty
             reporting: default
         7: Play/Pause Fn             , default: Play/Pause                  => Play/Pause                
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:8, group:0, group mask:empty
             reporting: default
         8: Next Fn                   , default: Next                        => Next                      
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:9, group:0, group mask:empty
             reporting: default
         9: Mute Fn                   , default: Mute                        => Mute                      
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:10, group:0, group mask:empty
             reporting: default
        10: Volume Down Fn            , default: Volume Down                 => Volume Down               
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:11, group:0, group mask:empty
             reporting: default
        11: Volume Up Fn              , default: Volume Up                   => Volume Up                 
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:12, group:0, group mask:empty
             reporting: default
        12: unknown:0103              , default: unknown:00D8                => unknown:00D8              
             nonstandard, reprogrammable, divertable, analytics key events, pos:0, group:0, group mask:empty
             reporting: default
        13: unknown:0104              , default: unknown:00D9                => unknown:00D9              
             nonstandard, reprogrammable, divertable, analytics key events, pos:0, group:0, group mask:empty
             reporting: default
        14: unknown:0105              , default: unknown:00DA                => unknown:00DA              
             nonstandard, reprogrammable, divertable, analytics key events, pos:0, group:0, group mask:empty
             reporting: default
        15: unknown:0106              , default: unknown:00DB                => unknown:00DB              
             nonstandard, reprogrammable, divertable, analytics key events, pos:0, group:0, group mask:empty
             reporting: default
        16: unknown:0107              , default: unknown:00DC                => unknown:00DC              
             nonstandard, reprogrammable, divertable, analytics key events, pos:0, group:0, group mask:empty
             reporting: default
        17: unknown:0108              , default: LedToggle                   => LedToggle                 
             nonstandard, reprogrammable, divertable, analytics key events, pos:0, group:0, group mask:empty
             reporting: default
        18: F Lock                    , default: Do Nothing One              => Do Nothing One            
             is FN, analytics key events, pos:0, group:0, group mask:empty
             reporting: default
        19: unknown:0034              , default: Do Nothing One              => Do Nothing One            
             nonstandard, analytics key events, pos:0, group:0, group mask:empty
             reporting: default
     Battery: 100%, discharging.

  2: Logi POP Mouse
     Device path  : None
     WPID         : B030
     Codename     : Logi POP Mous
     Kind         : mouse
     Protocol     : HID++ 4.5
     Serial number: D235B5D6
     Model ID:      B03000000000
     Unit ID:       D235B5D6
        Bootloader: BL1 55.00.B0004
          Firmware: RBM 20.00.B0004
             Other: 
     The power switch is located on the (unknown).
     Supports 32 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
            Firmware: Bootloader BL1 55.00.B0004 B030668A051E
            Firmware: Firmware RBM 20.00.B0004 B030668A051E
            Firmware: Other   
            Unit ID: D235B5D6  Model ID: B03000000000  Transport IDs: {'btleid': 'B030'}
         3: DEVICE NAME            {0005}   
            Name: Logi POP Mouse
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B}   
         5: RESET                  {0020}   
         6: CRYPTO ID              {0021}   
         7: DEVICE FRIENDLY NAME   {0007}   
            Friendly Name: Logi POP Mouse
         8: UNIFIED BATTERY        {1004}   
         9: REPROG CONTROLS V4     {1B04}   
            Key/Button Actions (saved): {'264': 264, '82': 82}
            Key/Button Actions        : {'82': 82, '264': 264}
        10: CHANGE HOST            {1814}   
            更改主機號碼        : 1:cjslappy
        11: HOSTS INFO             {1815}   
            Host 0 (paired): cjslappy
            Host 1 (unpaired): 
            Host 2 (unpaired): 
        12: XY STATS               {2250}   
        13: LOWRES WHEEL           {2130}   
            Wheel Reports: HID
            Scroll Wheel Diversion (saved): False
            Scroll Wheel Diversion        : False
        14: ADJUSTABLE DPI         {2201}   
            靈敏度 (DPI) (saved): 1600
            靈敏度 (DPI)        : 1600
        15: unknown:00C3           {00C3}   
        16: DEVICE RESET           {1802}   internal, hidden, unknown:000010
        17: unknown:1803           {1803}   internal, hidden, unknown:000010
        18: CONFIG DEVICE PROPS    {1806}   internal, hidden, unknown:000010
        19: unknown:1816           {1816}   internal, hidden, unknown:000010
        20: OOBSTATE               {1805}   internal, hidden
        21: unknown:1830           {1830}   internal, hidden, unknown:000010
        22: unknown:1891           {1891}   internal, hidden, unknown:000008
        23: unknown:18A1           {18A1}   internal, hidden, unknown:000010
        24: unknown:1E00           {1E00}   hidden
        25: unknown:1E02           {1E02}   internal, hidden
        26: unknown:1E22           {1E22}   internal, hidden, unknown:000010
        27: unknown:1602           {1602}   
        28: unknown:1EB0           {1EB0}   internal, hidden, unknown:000010
        29: unknown:1861           {1861}   internal, hidden, unknown:000010
        30: unknown:18B1           {18B1}   internal, hidden, unknown:000010
        31: unknown:920A           {920A}   internal, hidden
     Has 5 reprogrammable keys:
         0: Left Button               , default: Left Click                  => Left Click                
             mse, analytics key events, pos:0, group:1, group mask:empty
             reporting: default
         1: Right Button              , default: Right Click                 => Right Click               
             mse, analytics key events, pos:0, group:1, group mask:empty
             reporting: default
         2: Middle Button             , default: Mouse Middle Button         => Mouse Middle Button       
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         3: unknown:0108              , default: LedToggle                   => LedToggle                 
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         4: Virtual Gesture Button    , default: Virtual Gesture Button      => Virtual Gesture Button    
             divertable, virtual, raw XY, force raw XY, pos:0, group:3, group mask:empty
             reporting: default
     Battery: 100%, discharging.


```
</details>

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. pair the keyboard with Logi Bolt
2. start a input area (console, notepad app, browser, anything)
3. press any of the four button
4. nothing shows

all the tools revealed in [Arch Wiki](https://wiki.archlinux.org/title/Keyboard_input) report nothing.

1. showkey --scancodes dies out after 10 seconds as if nothing input, even though I constantly go through the four keys
2. evtest and xev doesn't return anything.

**Additional context**

The keymap is set to en, 104 generic keyboard

under Windows, the keys (all four of them) are reported as keycode 231 under https://keycode.info, and is output directly as the preset emoji.

I don't know if it is a driver issue, or xkb configuration issue though.

Let me know if you need more test, or has some idea to at least get the keystroke signal.


Discussion:
Solaar is not an input driver.  So if the keyboard produces regular input that is not correctly handled by the Linux keyboard input drivers and other parts of Linux, Solaar does not directly intervene.   
What Solaar can do in some cases for keyboards is to change what the keyboard does when a key is pressed.  To see what might be possible requires the output ot `solaar show`, which is missing here.
solaar show done

Many Logitech keyboards like the emoji keys the Pop has do things that only work in Windows and maybe only then with the Logitech driver.  
Solaar can modify the action of some of these keys to something useful, but this requires that Solaar knows about the actions, which does not appear to be the case for many of the Pop keys.  Solaar can also modify the action of some of these keys to send a special message that Solaar can then use to trigger its rules.
To make this work well, Solaar needs to know what the numbers in the output of `solaar show` mean, e.g.,
```
13: unknown:0104              , default: unknown:00D9    
```
You can help by following the process in issue #1307 to find out what, for example, key 0104 actually is.
Solaar from this repository already does know about  some of the keys because they are shared with the MX Keys for business, and MX Mini.

The bottom line is that you probably can get these keys to do something useful, but maybe not actually insert the emoji.

Resolving patch:
diff --git a/lib/logitech_receiver/special_keys.py b/lib/logitech_receiver/special_keys.py
--- a/lib/logitech_receiver/special_keys.py
+++ b/lib/logitech_receiver/special_keys.py
@@ -74,6 +74,7 @@
     My_Videos=0x0031,
     My_Computer_As_HID=0x0032,
     My_Computer_As_Win_E=0x0033,
+    FN_Key=0x0034,
     Launch_Picture_Viewer=0x0035,
     One_Touch_Search=0x0036,
     Preset_1=0x0037,
@@ -266,12 +267,40 @@
     Multiplatform_App_Switch_2=0x0100,  # Multiplatform_App_Switch
     Fn_Inversion__Hot_Key=0x0101,
     LeftAndRightClick=0x0102,
-    Show_Desktop_Fn=0x0103,  # MX Keys for Business Fn F5 ; MX Mini Fn F6 Dictation
-    Backlight_Down_Fn=0x0108,  # MX Keys for Business Fn F6 ; MX Mini Fn F7 Emoji
-    Screenshot=0x010A,  # MX Keys for Business top 3rd from right; MX Mini Fn F8 Screenshot
-    Lock_Fn=0x0117,  # MX Mini Lock (on delete key in function row)
-    Backlight_Up_Fn=0x011C,  # MX Keys for Business Fn F7 ; MX Mini Fn F9 Microphone Mute
-    LED_Toggle=0x013B,  #
+    Voice_Dictation=0x0103,  # MX Keys for Business Fn F5 ; MX Mini Fn F6 Dictation
+    Emoji_Smiley_Heart_Eyes=0x0104,
+    Emoji_Crying_Face=0x0105,
+    Emoji_Smiley=0x0106,
+    Emoji_Smilie_With_Tears=0x0107,
+    Open_Emoji_Panel=0x0108,  # MX Keys for Business Fn F6 ; MX Mini Fn F7 Emoji
+    Multiplatform_App_Switch__Launchpad=0x0109,
+    Snipping_Tool=0x010A,  # MX Keys for Business top 3rd from right; MX Mini Fn F8 Screenshot
+    Grave_Accent=0x010B,
+    Tab_Key=0x010C,
+    Caps_Lock=0x010D,
+    Left_Shift=0x010E,
+    Left_Control=0x010F,
+    Left_Option__Start=0x0110,
+    Left_Command__Alt=0x0111,
+    Right_Command__Alt=0x0112,
+    Right_Option__Start=0x0113,
+    Right_Control=0x0114,
+    Right_Shift=0x0115,
+    Insert=0x0116,
+    Delete=0x0117,  # MX Mini Lock (on delete key in function row)
+    Home=0x118,
+    End=0x119,
+    Page_Up=0x11A,
+    Page_Down=0x11B,
+    Mute_Microphone=0x11C,  # MX Keys for Business Fn F7 ; MX Mini Fn F9 Microphone Mute
+    Do_Not_Disturb=0x11D,
+    Backslash=0x11E,
+    Refresh=0x11F,
+    Close_Tab=0x120,
+    Lang_Switch=0x121,
+    Standard_Key_A=0x122,
+    Standard_Key_B=0x123,
+    Standard_Key_C=0x124,  # There are lots more of these
 )
 
 for i in range(1, 33):  # add in G keys - these are not really Logitech Controls
@@ -314,7 +343,6 @@
     WindowsRestore=0x001B,
     WindowsMinimize=0x001C,
     Music=0x001D,  # also known as MediaPlayer
-
     # Both 0x001E and 0x001F are known as MediaCenterSet
     Media_Center_Logitech=0x001E,
     Media_Center_Microsoft=0x001F,
@@ -493,7 +521,43 @@
     App_Switch=0x00D5,
     Fn_Inversion=0x00D6,
     LeftAndRightClick=0x00D7,
-    LedToggle=0x00DD,  #
+    Voice_Dictation=0x00D8,
+    Emoji_Smiling_Face_With_Heart_Shaped_Eyes=0x00D9,
+    Emoji_Loudly_Crying_Face=0x00DA,
+    Emoji_Smiley=0x00DB,
+    Emoji_Smiley_With_Tears=0x00DC,
+    Open_Emoji_Panel=0x00DD,
+    Multiplatform_App_Switch__Launchpad=0x00DE,
+    Snipping_Tool=0x00DF,
+    Grave_Accent=0x00E0,
+    Standard_Tab_Key=0x00E1,
+    Caps_Lock=0x00E2,
+    Left_Shift=0x00E3,
+    Left_Control=0x00E4,
+    Left_Option__Start=0x00E5,
+    Left_Command__Alt=0x00E6,
+    Right_Command__Alt=0x00E7,
+    Right_Option__Start=0x00E8,
+    Right_Control=0x00E9,
+    Right_Shift=0x0EA,
+    Insert=0x00EB,
+    Delete=0x00EC,
+    Home=0x00ED,
+    End=0x00EE,
+    Page_Up=0x00EF,
+    Page_Down=0x00F0,
+    Mute_Microphone=0x00F1,
+    Do_Not_Disturb=0x00F2,
+    Backslash=0x00F3,
+    Refresh=0x00F4,
+    Close_Tab=0x00F5,
+    Lang_Switch=0x00F6,
+    Standard_Alphabetical_Key=0x00F7,
+    Right_Option__Start__2=0x00F8,
+    Left_Option=0x00F9,
+    Right_Option=0x00FA,
+    Left_Cmd=0x00FB,
+    Right_Cmd=0x00FC,
 )
 TASK._fallback = lambda x: 'unknown:%04X' % x
 # Capabilities and desired software handling for a control


Test patch: