polychromatic icon indicating copy to clipboard operation
polychromatic copied to clipboard

Can't bind macros to FN+(1-0) and assign macros to profiles

Open ghost opened this issue 6 years ago • 8 comments

I own a Razer Ornata Chroma, when i press FN+MACRO it starts recording, the issue is - its impossible to stop recording!

And it would be nice to be able to assign effects to profiles, and like in Windows switch between them with FN+(1-0)

ghost avatar Sep 23 '17 12:09 ghost

Adding marco UI support for Polychromatic profiles is planned, but for now, the on-the-fly macros feature is handled by the daemon.

The problem is that the daemon only accepts M1-M5 keys... your keyboard has the same issue as my BlackWidow Ultimate 2016. You'll have to edit this file in a text editor:

/usr/lib/python3/dist-packages/openrazer_daemon/misc/key_event_management.py

And delete these lines:

                    if self._current_macro_bind_key is None:
-                        # Restrict macro bind keys to M1-M5
-                        if key_name not in ('M1', 'M2', 'M3', 'M4', 'M5'):
-                            self._logger.warning("Macros are only for M1-M5 for now.")
-                            self._recording_macro = False
-                            self._parent.setMacroMode(False)
-                        else:
                            self._current_macro_bind_key = key_name
                            self._parent.setMacroEffect(0x00)

Then restart the daemon. You can bind macros to any key... (but possibly not FN+1-9, but you could try). AFAIK, macros will be re-written in the daemon, but it seems a long way off yet.

lah7 avatar Sep 23 '17 13:09 lah7

The directory you provided doesn`t exist on my system

ghost avatar Sep 23 '17 14:09 ghost

Which distro? Yours might be in site-packages instead of dist-packages.

lah7 avatar Sep 23 '17 15:09 lah7

I am on Arch

ghost avatar Sep 23 '17 15:09 ghost

@Qik000 On Arch Linux the path is /usr/lib/python3.6/site-packages/openrazer_daemon/misc/key_event_management.py

z3ntu avatar Jan 28 '18 10:01 z3ntu

/usr/lib/python3.7/site-packages/openrazer_daemon/misc/key_event_management.py

works on Ornata (sort of, but not very convincingly). without the mod its a complete no workie on Ornata.

dimyme avatar Apr 01 '19 00:04 dimyme

Hi, I'm having this exact problem with my Cynosa keyboard. I've tried reinstalling openrazer and the Macro light won't stop flashing. I attempted the fix a previous user suggested by deleting the following lines: if self._current_macro_bind_key is None:

  •                    # Restrict macro bind keys to M1-M5
    
  •                    if key_name not in ('M1', 'M2', 'M3', 'M4', 'M5'):
    
  •                        self._logger.warning("Macros are only for M1-M5 for now.")
    
  •                        self._recording_macro = False
    
  •                        self._parent.setMacroMode(False)
    
  •                    else:
                          self._current_macro_bind_key = key_name
                          self._parent.setMacroEffect(0x00)
    

However, file that these lines are supposed to be located in is blank when I open with a text editor. I tried to open libre office and it says the file doesn't exist. I'm running Ubuntu 19.04. Does anyone know a way around this? I'd really appreciate any help

EasternStandardHazen avatar Aug 09 '19 20:08 EasternStandardHazen

@EasternStandardHazen I just checked Ubuntu 19.10 and it's the same place. LibreOffice is not an ideal text editor for editing this sort of file. Assuming you've got a clean reinstall of OpenRazer, try this:

  1. Open Terminal and type:

    sudo nano /usr/lib/python3/dist-packages/openrazer_daemon/misc/key_event_management.py
    
  2. Press CTRL + W and paste (CTRL+SHIFT+V):

    if self._current_macro_bind_key is None:
    
  3. Then delete the lines underneath using CTRL + K

  4. Press CTRL + X then Y then ENTER to save.

  5. Restart the daemon:

    openrazer-daemon -r
    

Please note that this is still just a hack. I don't know if the FN+[1-9] keys work, since the daemon still awaits improvements in this area.

lah7 avatar Aug 11 '19 10:08 lah7