GithubHelp home page GithubHelp logo

dokutan / mouse_m908 Goto Github PK

View Code? Open in Web Editor NEW
191.0 7.0 32.0 2.15 MB

Control various Redragon gaming mice from Linux, BSD and Haiku

License: GNU General Public License v3.0

C++ 98.13% Makefile 0.93% Roff 0.25% Shell 0.10% CMake 0.48% Meson 0.11%
mouse usb-mouse-driver rgb-perhipherals

mouse_m908's Introduction

mouse_m908

Control Redragon gaming mice from Linux, BSD and Haiku

Important

This software is not supported by the manufacturer of the hardware in any way, and relies completely on information from reverse-engineering. There is no warranty, especially in case of damage to the hardware.

Caution

This software can make your mouse unusable, read the safety section before using this software.

Note

This software is no longer actively developed:

  • Pull requests are welcome and will be merged
  • I will not implement new features/support new mice
  • I will try to reply to issues

Supported mice

All known settings from the official software are implemented for the M908 and M719. The other mice have varying levels of support.

If you have a mouse with VID 0x04d9 that is not listed below, there is a good chance that it is easy to add support. You can help to improve the support for your mouse by reporting what works and what doesn't, or by capturing the usb communication with the official software. Please open an issue.

The various levels of support mean the following:

  • unsupported : these mice are not compatible, support could be implemented but this will require more information about the protocol
  • generic : no code specific to the mouse is written, this exists primarily to test whether the mouse uses a compatible protocol
  • experimental : a backend specific to the mouse exists, but is untested or has major problems
  • partial : some features work, others might not or are untested, and there are no known problems making the software unusable
  • complete : all known features are implemented
Name Support VID:PID Additional notes
Redragon M908 Impact
Pusat V8
complete 0x04d9:0xfc4d
Redragon M719 Invader complete 0x04d9:0xfc4f
Redragon M607 Griffin partial 0x04d9:0xfc38 At least reading the settings is not working correctly
Redragon M711 Cobra partial 0x04d9:0xfc30 See this issue
Redragon M711 Cobra FPS partial 0x04d9:0xfc30 DPI values above 10000 are not supported
Redragon M913
UtechSmart Venus Pro RGB
partial 0x25a7:0xfa07
0x25a7:0xfa08
See this issue
- Uses a different and unique protocol
- Not all features are implemented
Redragon M686 experimental 0x25a7:0xfa34
0x25a7:0xfa35
See this issue
Redragon M709 Tiger experimental 0x04d9:0xfc2a See this issue
- Changing the profile works
- Changing the settings is untested
- Macros are untested
- Reading the settings is not properly implemented due to a lack of data
Redragon M715 Dagger experimental 0x04d9:0xfc39 Nothing is tested
- The device specific code is copied from the M711 and mostly unmodified
Redragon M721-Pro Lonewolf2 experimental 0x04d9:0xfc5c See this issue
Nothing is tested
Redragon M990 Legend experimental 0x04d9:0xfc0f See this issue
This mouse uses a different data format, keycodes, etc.
Redragon M990 Legend (RGB/Chroma) experimental 0x04d9:0xfc41 - Changing the profile works
- Reading the settings works partially
Redragon M702-2 Phoenix generic 0x04d9:0xfc2f - Changing the led mode and color works
Redragon M909 Emperor generic 0x04d9:0xfc42 please read this
Redragon M802 Titanoboa 2 generic 0x04d9:0xfc42 please read this
Redragon 2858 (?) generic 0x04d9:0xfc5e please read this
Redragon 2805 (?) generic 0x04d9:0xfc58 please read this
Redragon M612-RGB Predator generic 0x04d9:0xfc61 please read this
Redragon M901 Perdition generic 0x04d9:0xfc02 please read this
Redragon M901 Perdition (3) generic 0x04d9:0xfc40 please read this
Redragon M801 Mammoth (RGB?) generic 0x04d9:0xfc56 please read this
Redragon M910 Ranger generic 0x04d9:0xfc49 please read this
Redragon M998-RGB
Redragon M808-RGB
generic 0x04d9:0xfc5f please read this
Redragon (?) generic 0x04d9:0xfc3f please read this
Redragon M902 Samsara unsupported 0x04d9:0xfc01 See this issue
Redragon M801 Sniper Pro unsupported 0x25a7:0xfa0a Likely to share a protocol with the M913 and M686 which is not fully reverse engineered
Redragon M702 Phoenix unsupported 0x04d9:0xfc15 See this issue
Uses a different protocol
Redragon M801 Mammoth unsupported 0x04d9:0xfa56 See this issue
Uses a different protocol
Redragon M601-RGB unsupported 0x258a:0x1007 Use https://github.com/so1der/m601 instead of this project
Uses a different and unique(?) protocol

If you have a mouse with experimental support, your help is needed to improve this software. Please report your results (working and non-working software).

Generic support

If your mouse is listed as having generic support:

  • Nothing is known about this mouse, no specific code has been written
  • Please expect nothing beyond changing the active profile (other features might work if you are lucky)
  • There will be bugs, potentially preventing the mouse from working correctly
  • Please open an issue to add complete support

Safety

This software can make your mouse unusable. While this is very unlikely in the case of mice with complete support, all other mice are at a higher risk. This section lists known problems and ways to fix them.

  • M602A-RGB, M910-K
    • Issue: changing the the settings on the prevents moving the mouse in the vertical direction
    • Potential solution: use the official software to restore the settings
  • Old versions of this software (fixed in newer versions)
    • Issue: disabling all DPI levels makes the mouse completely unresponsive
    • Solution: use the official software to restore the settings and use a recent version of this software to prevent this from happening
  • Mice with generic or untested experimental support
    • Issue: Changing the settings has an increased risk of similar problems as described above
    • Potential solution: have a second mouse and the official software available to restore the settings in case of an issue

Installing

Linux

  • Install the dependencies:
    • libusb (On some distributions (e.g. Ubuntu) a dev package is required)
  • Clone this repo or download a release and run
make
sudo make install
  • Restart to get userspace access to the mouse via the installed udev rule
  • Uninstall with
sudo make uninstall

Arch Linux

An AUR package is available for the latest release.

Fedora/RHEL

RPM Package support was added so you can install mouse_m908 via your package manager.

  • Clone this repo
  • Install build dependencies: dnf builddep mouse_m908.spec
  • run:
make
make rpm
  • Install the resulting package by running:
sudo dnf install ./mouse_m908*.rpm

OpenBSD and FreeBSD

  • Install dependencies:
    • OpenBSD: libusb1
    • FreeBSD: pkgconf
  • Clone this repo and compile with
make CC=clang++
  • Install with: (run as root)
make install-bsd
  • OpenBSD: The --kernel-driver option is required
  • FreeBSD: Running as root is required, however if you know how to fix this please let me know
  • Uninstall with:
make uninstall

Haiku

  • Install dependencies: libusb and libusb_devel (from the HaikuPorts repo)
  • Clone this repo and compile with
make
  • Run with ./mouse_m908 or build a .hpkg package for installation with
make hpkg
  • This should create a file named mouse_m908.hpkg in the Haiku directory. The .hpkg package can be installed with HaikuDepot.
  • The --kernel-driver option is required

Other platforms

Other platforms are not tested, however as long as the dependencies are available there is no special reason they should not be compatible. If you (tried) to compile on a platform that is not listed above, please report your results so this file can be updated (and potential bugs can be fixed).

CMake

You can also use cmake to build mouse_m908 with the following commands:

cmake -Bbuild
cmake --build build
cmake --install build

Please note that this is currently experimental and only tested on Linux, however the plan is to eventually transition to cmake for all platforms.

Usage

The settings are stored in a file and applied all at once (except macros, see below). See examples/example_m*.ini and keymap.md

  • Apply the example configuration: mouse_m908 -c examples/example_m908.ini
  • To explicitly state which mouse to open, use the --model option, e.g. for the M709 mouse_m908 -c examples/example_m709.ini -M 709
  • Read the configuration from the mouse and store it in config.ini: mouse_m908 -R config.ini
  • Set active profile to number 3: mouse_m908 -p 3
  • Get usage info: mouse_m908 -h
  • Send macro example.macro to slot 1: mouse_m908 -m examples/example.macro -n 1
  • Send all macros from example_m908.ini: mouse_m908 -m examples/example_m908.ini

Macros

There is space for 15 macros on the mouse, these are shared over all profiles. Each macro can hold up to 67 actions, any further actions get ignored.

There are two file formats in which macros can be specified, one macro per file (the older type) and multiple macros as comments in the config.ini file (as produced by mouse_m908 --read).

To set a macro to a specific button:

  1. Create a file containing the macro actions
  2. Add macro⟨N⟩ to the button mapping configuration to set a button to the ⟨N⟩th macro
  3. Apply the configuration: mouse_m908 -c ⟨config.ini⟩
  4. Depending on the file format:
    • older type: Apply the specific macro: mouse_m908 -m ⟨macrofile⟩ -n ⟨N⟩
    • newer type: Apply all macros: mouse_m908 -m ⟨config.ini⟩

Macro file

Each line contains an action and a parameter separated by a tab. Supported actions are:

  • down ⟨key⟩
  • up ⟨key⟩
  • delay ⟨1-255⟩
  • move_left ⟨1-120⟩
  • move_right ⟨1-120⟩
  • move_up ⟨1-120⟩
  • move_down ⟨1-120⟩

examples/example.macro for an example of the older file format, examples/example_m*.ini for an example of the newer format, keymap.md section Keyboard keys/Keys for a list of recognized Keys. Supported mousebuttons (up and down):

  • mouse_left
  • mouse_right
  • mouse_middle
  • mouse_forward
  • mouse_backward

--bus and --device options

With these options the USB bus id and device number can be specified. This is useful if there are multiple devices with the same vendor and product id, or if the particular device has a different vendor or product id that is not expected by this software.

--kernel-driver option

On some systems libusb might not be able to detect or detach kernel drivers, this results in a failure because the mouse can not be opened. This options skips this step.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

mouse_m908's People

Contributors

40476 avatar akdev1l avatar desiderantes avatar dokutan avatar g-fb avatar halt-spesn avatar mnmustafa1109 avatar nullbuffer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mouse_m908's Issues

M801 Sniper Pro Support

I have a M801 Sniper Pro mouse and was wonder if it would be possible to add support for it.
From a lsusb I got
Bus 001 Device 008: ID 25a7:fa0a Areson Technology Corp 2.4G Dual Mode Mouse
Though I noticed this is different from the 04d9 that seems to be expected so I'm unsure if that causes any issues. I can try to provide any other information if necessary.

Thank you!

Change backlight color of REDRAGON M910-K

Hi,

I would only like to change backlight color of my REDRAGON M910-K Gaming mouse. No other special configurations, macros, additive profiles, etc. .
Can I use this software to do this?
Which information I have to post here to understand if this is feasible?
Please, guide me to accomplish this task.

Thanks :)

Redragon M686 Support

I am using a M686 Vampire Elite mouse and I am inquiring about possible support for this mouse and am willing to help contribute, I play Roblox daily and do general web browsing, so this mouse sees frequent use on my part.

M910-K Not working

Hi,
I got a Redragon M910-K mouse and applied the program using the example_generic file. After applying that the mouse can only go left and right but not up and down anymore. What did I do wrong? Is there a fix so can one revert the changes?

M908 Fire Button

I'm experiencing some issues with the M908 fire button in Manjaro Linux, I got the AUR package 3.4-1.

The button isn't working properly here, most of the times the effect of double/triple left mouse click isn't occurring.
This is my configuration:

# Model: 908
# Configuration created with mouse_m908 -R.
# This configuration can be send to the mouse with mouse_m908 -c.
# Note: reading the scrollspeed is not supported by the mouse.

# Currently active profile: 1

[profile1]

# LED settings
color=ffffff
brightness=1
speed=2
lightmode=static
report_rate=500

# DPI settings
# Active dpi level for this profile: 1
dpi1_enable=0
dpi1=500
dpi2_enable=0
dpi2=1000
dpi3_enable=0
dpi3=2000
dpi4_enable=1
dpi4=3000
dpi5_enable=1
dpi5=6200

# Button mapping
button_left=left
button_right=right
button_middle=middle
button_fire=fire:mouse_left:3:1
button_dpi_up=dpi+
button_dpi_down=dpi-
button_1=F1
button_2=F2
button_3=F3
button_4=F4
button_5=F5
button_6=F6
button_7=F7
button_8=F8
button_9=F9
button_10=F10
button_11=F11
button_12=F12
scroll_up=scroll_up
scroll_down=scroll_down

Support Confirmation: Pusat V8

Hello,
I have Pusat V8 mice which is identical to Redragon M908. So I tried the driver of M908 on my mice on Fedora 37 and it is fully working.

It took me a while finding this driver. I hope next person who search it will be lucky :). Let me leave some tags here.

Pusat V8 open source driver. Pusat V8 açık kaynak sürücüsü.

Thanks for you great work!

M990 Legend (not RGB/Chroma) support

Hey there. Been watching this project for a long time. Keep up the great work!

Unfortunately, though, the current build does not support my M990 Legend(PN70389) with any of the available profiles. And I've been too busy to capture the USB data... until now.

So, here it goes: https://github.com/rfxDarth/m990_capture_data

If there's anything else I can provide or help you with, please, let me know.

Note, though, that this is different from M990 Legend Chroma(PN 78345) as the software is incompatible. There might have been even been multiple revisions, as the software they offer for 70389 is broken too. So, for anyone who might stumble here from google, I've uploaded an older but working version to https://github.com/rfxDarth/m990_legend-software.

Possible to assign other mouse functions to m908?

I would like to assign mouse right/left tilt click function to a key on the m908 (tilt click is when the scroll wheel tilts to the right/left on some mice and actually registers a click - usually for scrolling horizontally). The m908 doesn't actually have native tilt click functionality but is it possible to use this to program the m908 to send a tilt click when pressing a key?

Error reading macros from M908

Hi,
I'm an Arch user and I've a brand new Redragon M908.
Reading mouse config with mouse_m908 -R config_2.ini generate the file correctly.
When I read file contents I see

;## macro1
;# unknown, please report as bug: 81 1 0
;# up mouse_left

The second line should be simply a down mouse_left command that I've previously sent to the device with mouse_m908 -m ./macro_click.macro -n 1.

This file contains only

down mouse_left
up mouse_left

There is something that I'm doing wrong or there is a bug to watch for?

Thanks in advance!

M990 RGB Legend Chroma support

I did not try to reconfigure mouse buttons yet, the new mouse has default configuration. When I tried to read configuration with mouse_m908 -R - it displayed:

button_fire=unknown, please report as bug:  92  3  1  0

for all the profiles. Other buttons reported without errors. The fire button by default works like left button (and xev reported it as "button 1").

The full output of the commands:

M601-RGB Support

Hello there! I couldn't reopen Issue #58, thats why I started new one.
I have a M601-RGB mouse (model Centrophorus2), with same VID:PID as in M602-1 from issue I mentioned above.

Bus 001 Device 006: ID 258a:1007 SINOWEALTH Wired Gaming Mouse

I tried to reverse engineer its protocol, by capturing packages from original software in wireshark, starting with change of mouse mode, and I think I did gather some info, but because of my lack of knowledge in C/USB, I couldn't check it.
To change Mouse Mode, software sends package by USBHID protocol to Endpoint 0x00 OUT:

bmRequestType: 0x21
bRequest: SET_REPORT (0x09)
wValue: 0x0305
wIndex: 1
wLength: 6
Data Fragment: 05 02 01 00 00 00

01 byte in this case response for mode selection. Mouse have 2 modes, so values are 01 or 02. I tried to send this data myself, but faced numerous problems I couldn't resolve. Thats why Im asking for Your help. Maybe I can create .pcap file, where I will capture all main packages, and describe in detail, what cause those packages, and provide screenshots of original software? Or maybe something else. Thats, of course, if You want to work on supporting such mouse.

PKGBUILD for Arch Linux

Current situation: At least three people (@esdrastarsis, @nwildner, @dokutan) are interested in a PKGBUILD for Arch Linux. At first @nwildner created a fork two days ago, that is now gone with intent to continue work on it (#2 (comment)). Now @esdrastarsis has opened a PR (#13). I am creating this issue because i don't know what the best action would be and to provide a place for further discussion.

Therefore i am asking you, @esdrastarsis, @nwildner what are your thoughts on this matter?

Edit: my suggestion would be to merge #13 and use it as a common base for further improvements by everyone.

nearly broke my m607 (affecting the generic backend → use the M607 backend instead)

oh god, I just read the instructions, found example config file for this mouse, made a couple of changes, tried to apply - and then mouse died. also I got warnings about unknown DPI value (example file said you can specify the DPI by exact value, but obviously that's a lie). lucky me, there is another computer with Windows, and I have revived my mouse by Redragon's soft. I understand that you dont give any guarantee, so I dont want to blame or offense you. I just want to say people - dont use this program if you are not IT-genius.
maybe I should specify DPI with these 00x3ffabcd, but what the hell is this, some kind of hexadecimal number?
here is config created with mouse_m908 -R
M607.txt

Control RGB Impact M908

Hello!

Congratulations on your work with this repo.

I am interested in purchasing a Redragon Impact M908 mouse and would like to know if your solution has a front-end to be able to configure the mouse's RGB?

Figuring out DPI values.

Very new to this kind of thing but have gotten it completely set up for my M908. Was wondering how you figure out exact DPI values to put into the mouse config file.

# dpi (4-8c) dpi1=04 dpi2=16 dpi3=2d dpi4=43 dpi5=8c

Those are the examples listed and was wondering exactly how you would determine the value needed for an exact DPI number.

Redragon M721-Pro Lonewolf2 support

Hi, I want to participate in adding support for this mouse.

lsusb
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 002: ID 046d:0826 Logitech, Inc. HD Webcam C525
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 04d9:fc5c Holtek Semiconductor, Inc. USB Gaming Mouse
Bus 001 Device 005: ID 04b4:6018 Cypress Semiconductor Corp.
Bus 001 Device 002: ID 045e:0719 Microsoft Corp. Xbox 360 Wireless Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
sudo mouse_m908 -R - --bus 1 --device 4 -M 709
# Configuration created with mouse_m908 -R.
# This configuration can be send to the mouse with mouse_m908 -c.
# This feature is currently untested, please report your results.
# Note: reading the scrollspeed is not supported by the mouse.

# Currently active profile: 5

[profile1]

# LED settings
color=ff0000
brightness=0
speed=0
lightmode=off

report_rate=500

# DPI settings
# Active dpi level for this profile: 1
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=left
button_right=right
button_middle=middle
button_forward=forward
button_backward=backward
button_dpi=fire:mouse_left:3:0
scroll_up=dpi+
scroll_down=dpi-

[profile2]

# LED settings
color=0000ff
brightness=2
speed=0
lightmode=wave

report_rate=500

# DPI settings
# Active dpi level for this profile: 2
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=led_mode_switch
button_right=profile_switch
button_middle=none
button_forward=none
button_backward=none
button_dpi=none
scroll_up=unknown, please report as bug:  ff  ff  0  0
scroll_down=none

[profile3]

# LED settings
color=00ff00
brightness=2
speed=0
lightmode=wave

report_rate=500

# DPI settings
# Active dpi level for this profile: 2
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=none
button_right=none
button_middle=scroll_up
button_forward=scroll_down
button_backward=left
button_dpi=right
scroll_up=middle
scroll_down=forward

[profile4]

# LED settings
color=ff00ff
brightness=2
speed=0
lightmode=wave

report_rate=500

# DPI settings
# Active dpi level for this profile: 2
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=backward
button_right=fire:mouse_left:3:0
button_middle=dpi+
button_forward=dpi-
button_backward=led_mode_switch
button_dpi=profile_switch
scroll_up=none
scroll_down=none

[profile5]

# LED settings
color=ffff00
brightness=3
speed=0
lightmode=alternating

report_rate=500

# DPI settings
# Active dpi level for this profile: 1
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=none
button_right=none
button_middle=unknown, please report as bug:  ff  ff  0  0
button_forward=none
button_backward=none
button_dpi=none
scroll_up=scroll_up
scroll_down=scroll_down

# Macros

After that, I changed report_rate for all my profiles in the Windows Redragon software. (from 500 to 1000)

Screenshot 2021-04-30 222737

sudo mouse_m908 -R - --bus 1 --device 7 -M generic
# Configuration created with mouse_m908 -R.
# This configuration can be send to the mouse with mouse_m908 -c.
# This feature is currently untested, please report your results.
# Note: reading the scrollspeed is not supported by the mouse.

# Currently active profile: 1

[profile1]

# LED settings
color=ff0000
brightness=2
speed=0
lightmode=wave

report_rate=1000

# DPI settings
# Active dpi level for this profile: 1
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=left
button_right=right
button_middle=middle
button_forward=forward
button_backward=backward
button_dpi=fire:mouse_left:3:0
scroll_up=dpi+
scroll_down=dpi-

[profile2]

# LED settings
color=0000ff
brightness=2
speed=0
lightmode=wave

report_rate=1000

# DPI settings
# Active dpi level for this profile: 2
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=led_mode_switch
button_right=profile_switch
button_middle=none
button_forward=none
button_backward=none
button_dpi=none
scroll_up=unknown, please report as bug:  ff  ff  0  0
scroll_down=none

[profile3]

# LED settings
color=00ff00
brightness=2
speed=0
lightmode=wave

report_rate=1000

# DPI settings
# Active dpi level for this profile: 2
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=none
button_right=none
button_middle=scroll_up
button_forward=scroll_down
button_backward=left
button_dpi=right
scroll_up=middle
scroll_down=forward

[profile4]

# LED settings
color=ff00ff
brightness=2
speed=0
lightmode=wave

report_rate=1000

# DPI settings
# Active dpi level for this profile: 2
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=backward
button_right=fire:mouse_left:3:0
button_middle=dpi+
button_forward=dpi-
button_backward=led_mode_switch
button_dpi=profile_switch
scroll_up=none
scroll_down=none

[profile5]

# LED settings
color=ffff00
brightness=2
speed=0
lightmode=wave

report_rate=1000

# DPI settings
# Active dpi level for this profile: 2
dpi1_enable=1
dpi1=0x0b00
dpi2_enable=1
dpi2=0x1700
dpi3_enable=1
dpi3=0x2f00
dpi4_enable=1
dpi4=0x5f00
dpi5_enable=1
dpi5=0xbc00

# Button mapping
button_left=none
button_right=none
button_middle=unknown, please report as bug:  ff  ff  0  0
button_forward=none
button_backward=none
button_dpi=none
scroll_up=scroll_up
scroll_down=scroll_down

# Macros

Support Redragon M901 Perdition

I have this mouse and would like full support. Happy to help any way I can. I am not a full time coder and haven't been for to many years to write driver code, but am happy to supply any information on this mouse that I can or other ways to support this effort.

Thank you,

Programming M602A-RGB Griffen causes bugs with mouse

I was hoping that the M602A-rgb would be similar enough to program with this software but I have encountered a bug.

From what I can tell most of the features work as in profiles, dpi, colors, leds etc, but once the mouse is flashed the mouse will only move in horizontal direction. Problem is definitely flashing as moving the mouse to a new computer or unplugging/plugging the mouse keeps the problem. Only way to fix it is to flash using official software on windows.

Is there any information I can provide to help troubleshoot/repair this issue? Is there a specific command line args I should be using for testing?

Thanks.

908 i can readout but not write config

hi there
my issue is, i can easy readout my mouse via [sudo mouse_m908 -R -]
it uses the one i made yesterday in a windows vm (just to preset the mouse,before i try my linux parts)
i tried the -c and the -m function and even a -c /path/to/the .ini
the mouse always flashes as it would write it,but it doesnt do so

any suggestions?
/edit
the mouse can be readout, the mouse can not get to work with some other commands
such as -k, -M etc,
then it always hands out Couldnt detect mouse.
but the readout works fine, and no, none of the macros work in linux.

/edit 2
the bus is the right one
Bus 007 Device 003: ID 04d9:fc4d Holtek Semiconductor, Inc. Gaming Mouse [Redragon M908]

Button mapping syntax and problem

button_11=-
button_12==

The above code does not function correctly, the result is button 11 returns nothing and button 12 returns -.

AUR package

Great project, starred. Would you mind uploading your PKGBUILD to the AUR, so I can manage the package via yay?

m913: Fire configuration (also Enter and snipe)

For the fire sequence, I've got a generated configuration from the stock settings. I believe the fire button was set to triple fire:

± sudo ./result/bin/mouse_m908 -R -
# Model: 913
# Configuration created with mouse_m908 -R.
# This configuration can be send to the mouse with mouse_m908 -c.
# Note: this feature is incomplete for the M913.

# Battery level: 80 %

# The M913 has two profiles that can be switched using the 'mode switch' button on the bottom of the mouse.
# Reading the settings can only be done for the active profile, therefore only profile1 is used in this config.
[profile1]

report_rate=125

# DPI settings
# Currently active DPI level: 2
dpi1=1000
dpi2=2000
dpi3=4000
dpi4=8000
dpi5=16000

# Button mapping
button_left=left
button_right=right
button_middle=middle
button_fire=unknown, please report as bug:  4  14  3  3a
button_1=keyboard_key
button_2=keyboard_key
button_3=keyboard_key
button_4=keyboard_key
button_5=keyboard_key
button_6=keyboard_key
button_7=keyboard_key
button_8=keyboard_key
button_9=keyboard_key
button_10=keyboard_key
button_11=keyboard_key
button_12=keyboard_key

As you can see, the program wanted me to report a bug :-)

Unfortunately, I didn't capture -D on the stock settings, before changing settings. Binding the fire command doesn't work. Testament to your incredible effort - thank you very much - I haven't even had to install a vm with the windows software so far, but let me know how I can help with any capturing or reversing, now that I already bought this thing.

I also can't seem to bind Enter, which you may already track in #29, and the snipe command also doesn't work.

Please can you support my redragon predator M612-RGB gaming mice?

lsusb output:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 30c9:000e Luxvisions Innotech Limited HP Wide Vision HD Camera
Bus 003 Device 003: ID 0bda:b00c Realtek Semiconductor Corp. Bluetooth Radio
Bus 003 Device 007: ID 04d9:fc61 Holtek Semiconductor, Inc. USB Gaming Mouse
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Package not building (arch and kde)

When trying to install the package thru the snapshot or with the PKGBUILD from cloning the repo, the build process was stopped due to an error. Here is the related output:

In file included from include/rd_mouse_wireless.cpp:19:
include/rd_mouse_wireless.h:35:58: error: ‘uint8_t’ was not declared in this scope
35 |                 static std::map< std::string, std::array<uint8_t, 4> > _c_keycodes;
|                                                          ^~~~~~~
include/rd_mouse_wireless.h:26:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
25 | #include <vector>
+++ |+#include <cstdint>
26 |
include/rd_mouse_wireless.h:35:68: error: template argument 1 is invalid
35 |                 static std::map< std::string, std::array<uint8_t, 4> > _c_keycodes;
|                                                                    ^
include/rd_mouse_wireless.h:35:70: error: template argument 2 is invalid
35 |                 static std::map< std::string, std::array<uint8_t, 4> > _c_keycodes;
|                                                                      ^
include/rd_mouse_wireless.h:35:70: error: template argument 4 is invalid
include/rd_mouse_wireless.h:38:24: error: ‘uint8_t’ does not name a type
38 |                 static uint8_t _i_keyboard_key_checksum(uint8_t scancode);
|                        ^~~~~~~
include/rd_mouse_wireless.h:38:24: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
include/rd_mouse_wireless.h:41:35: error: ‘uint8_t’ was not declared in this scope
41 |                 static std::array<uint8_t, 17> _c_data_button_as_keyboard_key;
|                                   ^~~~~~~
include/rd_mouse_wireless.h:41:35: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
include/rd_mouse_wireless.h:41:46: error: template argument 1 is invalid
41 |                 static std::array<uint8_t, 17> _c_data_button_as_keyboard_key;
|                                              ^
include/rd_mouse_wireless.cpp:21:35: error: ‘uint8_t’ was not declared in this scope
21 | std::map< std::string, std::array<uint8_t, 4> > rd_mouse_wireless::_c_keycodes = {
|                                   ^~~~~~~
include/rd_mouse_wireless.cpp:20:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
19 | #include "rd_mouse_wireless.h"
+++ |+#include <cstdint>
20 |
include/rd_mouse_wireless.cpp:21:45: error: template argument 1 is invalid
21 | std::map< std::string, std::array<uint8_t, 4> > rd_mouse_wireless::_c_keycodes = {
|                                             ^
include/rd_mouse_wireless.cpp:21:47: error: template argument 2 is invalid
21 | std::map< std::string, std::array<uint8_t, 4> > rd_mouse_wireless::_c_keycodes = {
|                                               ^
include/rd_mouse_wireless.cpp:21:47: error: template argument 4 is invalid
include/rd_mouse_wireless.cpp:21:49: error: scalar object ‘rd_mouse_wireless::_c_keycodes’ requires one element in initializer
21 | std::map< std::string, std::array<uint8_t, 4> > rd_mouse_wireless::_c_keycodes = {
|                                                 ^~~~~~~~~~~~~~~~~
include/rd_mouse_wireless.cpp:37:1: error: ‘uint8_t’ does not name a type
37 | uint8_t rd_mouse_wireless::_i_keyboard_key_checksum(uint8_t scancode){
| ^~~~~~~
include/rd_mouse_wireless.cpp:37:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
include/rd_mouse_wireless.cpp:41:12: error: ‘uint8_t’ was not declared in this scope
41 | std::array<uint8_t, 17> rd_mouse_wireless::_c_data_button_as_keyboard_key = {
|            ^~~~~~~
include/rd_mouse_wireless.cpp:41:12: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
include/rd_mouse_wireless.cpp:41:23: error: template argument 1 is invalid
41 | std::array<uint8_t, 17> rd_mouse_wireless::_c_data_button_as_keyboard_key = {
|                       ^
include/rd_mouse_wireless.cpp:41:25: error: scalar object ‘rd_mouse_wireless::_c_data_button_as_keyboard_key’ requires one element in initializer
41 | std::array<uint8_t, 17> rd_mouse_wireless::_c_data_button_as_keyboard_key = {
|                         ^~~~~~~~~~~~~~~~~
make: *** [makefile:114: rd_mouse_wireless.o] Error 1
==> ERROR: A failure occurred in build().
Aborting...

when using paru to install the package the following error output occurs:

In file included from include/rd_mouse_wireless.cpp:19:
include/rd_mouse_wireless.h:35:58: error: ‘uint8_t’ was not declared in this scope
35 |                 static std::map< std::string, std::array<uint8_t, 4> > _c_keycodes;
|                                                          ^~~~~~~
include/rd_mouse_wireless.h:26:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
25 | #include <vector>
+++ |+#include <cstdint>
26 |
include/rd_mouse_wireless.h:35:68: error: template argument 1 is invalid
35 |                 static std::map< std::string, std::array<uint8_t, 4> > _c_keycodes;
|                                                                    ^
include/rd_mouse_wireless.h:35:70: error: template argument 2 is invalid
35 |                 static std::map< std::string, std::array<uint8_t, 4> > _c_keycodes;
|                                                                      ^
include/rd_mouse_wireless.h:35:70: error: template argument 4 is invalid
include/rd_mouse_wireless.h:38:24: error: ‘uint8_t’ does not name a type
38 |                 static uint8_t _i_keyboard_key_checksum(uint8_t scancode);
|                        ^~~~~~~
include/rd_mouse_wireless.h:38:24: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
include/rd_mouse_wireless.h:41:35: error: ‘uint8_t’ was not declared in this scope
41 |                 static std::array<uint8_t, 17> _c_data_button_as_keyboard_key;
|                                   ^~~~~~~
include/rd_mouse_wireless.h:41:35: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
include/rd_mouse_wireless.h:41:46: error: template argument 1 is invalid
41 |                 static std::array<uint8_t, 17> _c_data_button_as_keyboard_key;
|                                              ^
include/rd_mouse_wireless.cpp:21:35: error: ‘uint8_t’ was not declared in this scope
21 | std::map< std::string, std::array<uint8_t, 4> > rd_mouse_wireless::_c_keycodes = {
|                                   ^~~~~~~
include/rd_mouse_wireless.cpp:20:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
19 | #include "rd_mouse_wireless.h"
+++ |+#include <cstdint>
20 |
include/rd_mouse_wireless.cpp:21:45: error: template argument 1 is invalid
21 | std::map< std::string, std::array<uint8_t, 4> > rd_mouse_wireless::_c_keycodes = {
|                                             ^
include/rd_mouse_wireless.cpp:21:47: error: template argument 2 is invalid
21 | std::map< std::string, std::array<uint8_t, 4> > rd_mouse_wireless::_c_keycodes = {
|                                               ^
include/rd_mouse_wireless.cpp:21:47: error: template argument 4 is invalid
include/rd_mouse_wireless.cpp:21:49: error: scalar object ‘rd_mouse_wireless::_c_keycodes’ requires one element in initializer
21 | std::map< std::string, std::array<uint8_t, 4> > rd_mouse_wireless::_c_keycodes = {
|                                                 ^~~~~~~~~~~~~~~~~
include/rd_mouse_wireless.cpp:37:1: error: ‘uint8_t’ does not name a type
37 | uint8_t rd_mouse_wireless::_i_keyboard_key_checksum(uint8_t scancode){
| ^~~~~~~
include/rd_mouse_wireless.cpp:37:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
include/rd_mouse_wireless.cpp:41:12: error: ‘uint8_t’ was not declared in this scope
41 | std::array<uint8_t, 17> rd_mouse_wireless::_c_data_button_as_keyboard_key = {
|            ^~~~~~~
include/rd_mouse_wireless.cpp:41:12: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
include/rd_mouse_wireless.cpp:41:23: error: template argument 1 is invalid
41 | std::array<uint8_t, 17> rd_mouse_wireless::_c_data_button_as_keyboard_key = {
|                       ^
include/rd_mouse_wireless.cpp:41:25: error: scalar object ‘rd_mouse_wireless::_c_data_button_as_keyboard_key’ requires one element in initializer
41 | std::array<uint8_t, 17> rd_mouse_wireless::_c_data_button_as_keyboard_key = {
|                         ^~~~~~~~~~~~~~~~~
make: *** [makefile:114: rd_mouse_wireless.o] Error 1
==> ERROR: A failure occurred in build().
Aborting...
error: failed to build 'mouse_m908-3.3-1':
error: packages failed to build: mouse_m908-3.3-1

When trying to install with pacman, it says package not found

basic ci/cd with github actions, build Fedora

Hi,

I would like to implement a basic ci/cd workflow to build the Fedora RPM package automatically whenever a new commit is pushed. (this could be extended for other supported platforms as well)

If you are interested I will take a stab at it and report back with a PR once I have something working. Creating this issue for reference and also to see if this is something you'd like to include in the project.

Plan

  1. Create .github/workflows/fedora-build.yml
  2. It will run tests and build the binary rpm for distribution
  3. It will only target Fedora 34/35 (current + previous Fedora versions)

Goal

  1. Users will be able to get binary packages for Fedora 34/35
  2. Eventually would like to set up a repository on https://copr.fedorainfracloud.org/ if inclusion in the Fedora repos is something wanted by the project

Let me know your thoughts!

Supported Device: UTech Venus Wireless Gaming Mouse

Looks like this mouse is supported and is a clone of the RedDragon M913.

UtechSmart Venus Pro RGB Wireless MMO Gaming Mouse:

https://www.amazon.com/UtechSmart-transmission-technology-Ergonomic-programmable/dp/B07XP4K152?th=1

lsusb output:

Bus 001 Device 007: ID 25a7:fa08 Areson Technology Corp 2.4G Dual Mode Mouse

I've only messed with the dpi settings thus far, so I'm not sure if it's identical, but I don't see why it wouldn't be at this point.

sudo mouse_m908 --read -

# Model: 913
# Configuration created with mouse_m908 -R.
# This configuration can be send to the mouse with mouse_m908 -c.
# Note: this feature is incomplete for the M913.

# Battery level: 100 %

# The M913 has two profiles that can be switched using the 'mode switch' button on the bottom of the mouse.
# Reading the settings can only be done for the active profile, therefore only profile1 is used in this config.
[profile1]

report_rate=1000

# DPI settings
# Currently active DPI level: 2
dpi1=1000
dpi2=1500
dpi3=2000
dpi4=8000
dpi5=16000

# Button mapping
button_left=left
button_right=right
button_middle=middle
button_fire=unknown, please report as bug:  4  14  3  3a
button_1=keyboard_key
button_2=keyboard_key
button_3=keyboard_key
button_4=keyboard_key
button_5=keyboard_key
button_6=keyboard_key
button_7=keyboard_key
button_8=keyboard_key
button_9=keyboard_key
button_10=keyboard_key
button_11=keyboard_key
button_12=keyboard_key

Mouse acceleration

I remember the the official software having a slider for mouse acceleration separate to "pointer speed". But I couldn't find it in this software, is it implemented? I'm on the m908

M702 Phoenix support

Hello, I have an M702 mouse, and would like to request support.

What information do you need?
(I’m good at Linux and programming, and will help wherever I can, so no need to simplify. :)

Macro problems with M908 Ubuntu

Running mouse_m908 -R - shows this at the end:


;## macro1
;# down	m
;# up	m
;# down	a
;# up	a
;# delay	1
;# down	c
;# up	c
;# down	r
;# up	r
;# delay	1
;# down	o
;# up	o
;# down	1
;# up	1
;# delay	1
;# delay	1

;## macro8
;# unknown, please report as bug: ff ff 0

Sending a configuration file to the mouse works, but macros are ignored.
Tested on two different machines with Ubuntu 20.04 and 21.10 respectively.

Reverse engeneering USB protocol (Redragon M711).

Hello, I'd like to the same you did, but with the model M711.
This is my first attempt reverse engineering something, so I'm having a hard time starting it.
After setting up the VM and Wireshark, I was able to capture some packets after changing values in the original software, but all packages were very small (average of 80 bytes) and were nothing like the dump found in your file "documentation/default-annotated".
Am I doing something wrong, or are the packages meant to be this size, and if so, how should I concat them to a better understending of the protocol.

Edit: just saw the README.md inside the documentation folder and it was very clarifying.

M990-RGB Legend Chroma settings read after pressing buttons

Here are the settings read after pressing the DPI+, LED and profile buttons.

When switching profile, the Currently active profile changes.
When switching DPI, Active dpi level for this profile: changes.
When switching LED mode, lightmode and sometimes speed change.

Profile switching also works.

Reverser engenieering USB protocol (Redragon M709).

Hello,
Since I have no other means to contact you I opened this issue.
I bought myself, a Redragon M709. Because I can't change any mouse related options on Linux I want write my own app like yours. I am interested how'd you reverse engineered protocol.

Thx.

Redragon M719 Invader

I bought a mouse "Redragon M719 Invader" and read config with command mouse_m908 -R mouse.ini

Default config in the attached file.

Hope this will be helpful. If I can help with something, just ask me :)

mouse.txt

Safety? and other questions

How likely is it that a mouse would be bricked due to its own bug, or a bug in the official software (does the latter work on WINE?)? I found a review of M990 Legend Chroma RGB, where the author says two mice bricked after a week, which he thought was from frequent reprogramming with the official software. With Firestorm (IIRC), the Reset button would help, but M990 has no such button. He bought another one and didn't reprogram it, and it didn't brick.

Modifiers in macros

Hey,

Are you able to use modifiers in macros?

For example, if I want an uppercase "a," how would I achieve that? I tried shift_l+a and the line just gets ignored when sending the macro.

Thanks!

m602-1

its not detected
Bus 001 Device 007: ID 258a:1007 SINOWEALTH Game Mouse
pls help

Saftey Feature Request

I was a dummy and fat fingered a command and sent the "example_m908.ini" to my M612.

This ended with a mouse that would not move left or right. Ops!

So, I tried re-sending the "generic" example, no help, have a second mouse, captured its config and sent it, no good.

So, found a Windowz box and fixed it there.

Cool.

But on to the feature request. Add a list of "known good" USB IDs and/or the ID that the configuration was captured from. Then if the devices ID isn't in that list, prompt the user with a warning before proceeding.

Keycode/Input for Scroll Lock

Just was wondering what would be the Input for binding Scroll Lock

Tried the following but it didn't bind:
button_fire=ScrollLock
button_fire=scrolllock

However doing button_fire=End binds End correctly.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.