Giter Club home page Giter Club logo

masterkeys-linux's Introduction

Hey! 👋

My name is RedFantom, which is, of course, a pseudonym.

  • 🔭 Currently I'm working as an Analog IC Researcher, but in my spare time I like to write code for all sorts of projects.
  • ☕ Coffee is the foundation upon which all my code is built.
  • 🐧 Permanent Linux user on desktop, laptop and VPS.

Visit TkinterEP

  • 🐍 Particularly I enjoy Python, C and Kotlin, but I'm always dabbling in different stuff.
  • 📷 When not coding, I enjoy film photography.
  • 📫 Drop me an e-mail on the address listed in my profile. I am always interested in new projects and ideas, as well as any questions regarding the projects I contribute to.

masterkeys-linux's People

Contributors

redfantom avatar

Stargazers

 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

Forkers

p1co ed00m dvash1

masterkeys-linux's Issues

Unable to compile: multiple definition of `LIBMK_MODEL_STRINGS'

Hi @RedFantom,
I'm on Fedora 33 and i got that compile error, both from github sources and pip sources.
This is the full output of setup.py:

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wvfldzt7/masterkeys/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wvfldzt7/masterkeys/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4wfkhqpw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/masterkeys                                                                                                  
         cwd: /tmp/pip-install-wvfldzt7/masterkeys/                                                                                                                                                                                                                                                                        
    Complete output (112 lines):                                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                           
    --------------------------------------------------------------------------------                                                                                                                                                                                                                                       
    -- Trying "Ninja" generator                                                                                                                                                                                                                                                                                            
    --------------------------------                                                                                                                                                                                                                                                                                       
    ---------------------------                                                                                                                                                                                                                                                                                            
    ----------------------                                                                                                                                                                                                                                                                                                 
    -----------------                                                                                                                                                                                                                                                                                                      
    ------------                                                                                                                                                                                                                                                                                                           
    -------                                                                                                                                                                                                                                                                                                                
    --                                                                                                                                                                                                                                                                                                                     
    Not searching for unused variables given on the command line.                                                                                                                                                                                                                                                          
    -- The C compiler identification is GNU 10.2.1                                                                                                                                                                                                                                                                         
    -- Detecting C compiler ABI info                                                                                                                                                                                                                                                                                       
    -- Detecting C compiler ABI info - done                                                                                                                                                                                                                                                                                
    -- Check for working C compiler: /usr/bin/cc - skipped                                                                                                                                                                                                                                                                 
    -- Detecting C compile features                                                                                                                                                                                                                                                                                        
    -- Detecting C compile features - done                                                                                                                                                                                                                                                                                 
    -- The CXX compiler identification is GNU 10.2.1                                                                                                                                                                                                                                                                       
    -- Detecting CXX compiler ABI info                                                                                                                                                                                                                                                                                     
    -- Detecting CXX compiler ABI info - done                                                                                                                                                                                                                                                                              
    -- Check for working CXX compiler: /usr/bin/c++ - skipped                                                                                                                                                                                                                                                              
    -- Detecting CXX compile features                                                                                                                                                                                                                                                                                      
    -- Detecting CXX compile features - done                                                                                                                                                                                                                                                                               
    -- Configuring done                                                                                                                                                                                                                                                                                                    
    -- Generating done                                                                                                                                                                                                                                                                                                     
    -- Build files have been written to: /tmp/pip-install-wvfldzt7/masterkeys/_cmake_test_compile/build                                                                                                                                                                                                                    
    --                                                                                                                                                                                                                                                                                                                     
    -------                                                                                                                                                                                                                                                                                                                
    ------------                                                                                                                                                                                                                                                                                                           
    -----------------                                                                                                                                                                                                                                                                                                      
    ----------------------                                                                                                                                                                                                                                                                                                 
    ---------------------------                                                                                                                                                                                                                                                                                            
    --------------------------------                                                                                                                                                                                                                                                                                       
    -- Trying "Ninja" generator - success                                                                                                                                                                                                                                                                                  
    --------------------------------------------------------------------------------                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                                                           
    Configuring Project                                                                                                                                                                                                                                                                                                    
      Working directory:                                                                                                                                                                                                                                                                                                   
        /tmp/pip-install-wvfldzt7/masterkeys/_skbuild/linux-x86_64-3.9/cmake-build                                                                                                                                                                                                                                         
      Command:
        cmake /tmp/pip-install-wvfldzt7/masterkeys -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-wvfldzt7/masterkeys/_skbuild/linux-x86_64-3.9/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python -DPYTHON_VERSION_STRING:STRING=3.9.0 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.9 -DPYTHON_LIBRARY:FILEPATH=/usr/lib64/libpython3.9.so -DSKBUILD:BOOL=TRUE -DCMAKE_MODULE_PATH:PATH=/usr/local/lib/python3.9/site-packages/skbuild/resources/cmake -DCMAKE_BUILD_TYPE:STRING=Release
    
    CMake Warning (dev) in CMakeLists.txt:
      No project() command is present.  The top-level CMakeLists.txt file must
      contain a literal, direct call to the project() command.  Add a line of
      code such as
    
        project(ProjectName)
    
      near the top of the file, but after cmake_minimum_required().
    
      CMake is pretending there is a "project(Project)" command on the first
      line.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- The C compiler identification is GNU 10.2.1
    -- The CXX compiler identification is GNU 10.2.1
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found PythonInterp: /usr/bin/python (found version "3.9")
    -- Found PythonLibs: /usr/lib64/libpython3.9.so (found version "3.9.0")
    -- Performing Test Weak Link MODULE -> SHARED (gnu_ld_ignore) - Success
    _modinit_prefix:PyInit_
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/pip-install-wvfldzt7/masterkeys/_skbuild/linux-x86_64-3.9/cmake-build
    [1/7] Building C object CMakeFiles/masterkeys.dir/masterkeys/masterkeys.c.o
    In file included from /usr/include/python3.9/Python.h:85,
                     from ../../../masterkeys/masterkeys.c:14:
    /usr/include/python3.9/pytime.h:153:60: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
      153 | PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts);
          |                                                            ^~~~~~~~
    /usr/include/python3.9/pytime.h:158:56: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
      158 | PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
          |                                                        ^~~~~~~~
    In file included from ../../../masterkeys/masterkeys.c:12:
    ../../../masterkeys/../libmk/libmk.h:147:13: warning: array ‘LIBMK_MODEL_STRINGS’ assumed to have one element
      147 | const char* LIBMK_MODEL_STRINGS[];
          |             ^~~~~~~~~~~~~~~~~~~
    [2/7] Building C object CMakeFiles/masterkeys.dir/libmk/libmk.c.o
    [3/7] Building C object CMakeFiles/mk.dir/libmk/libmk.c.o
    [4/7] Linking C shared library mk.so.0.1.0
    [5/7] Creating library symlink mk.so
    [6/7] Linking C shared module masterkeys.cpython-39-x86_64-linux-gnu.so
    FAILED: masterkeys.cpython-39-x86_64-linux-gnu.so
    : && /usr/bin/cc -fPIC -std=c99 -O2 -DNDEBUG  -Wl,--unresolved-symbols=ignore-all -Wl,--version-script="/tmp/pip-install-wvfldzt7/masterkeys/_skbuild/linux-x86_64-3.9/cmake-build/CMakeFiles/masterkeys-version-script.map" -shared  -o masterkeys.cpython-39-x86_64-linux-gnu.so CMakeFiles/masterkeys.dir/masterkeys/masterkeys.c.o CMakeFiles/masterkeys.dir/libmk/libmk.c.o  -Wl,-rpath,/tmp/pip-install-wvfldzt7/masterkeys/_skbuild/linux-x86_64-3.9/cmake-build:  /usr/lib64/libpython3.9.so  mk.so.0.1.0  -lusb-1.0 && :
    /usr/bin/ld: CMakeFiles/masterkeys.dir/libmk/libmk.c.o:(.data.rel.local+0x0): multiple definition of `LIBMK_MODEL_STRINGS'; CMakeFiles/masterkeys.dir/masterkeys/masterkeys.c.o:(.bss+0x0): first defined here
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "/usr/local/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 589, in setup
        cmkr.make(make_args, env=env)
      File "/usr/local/lib/python3.9/site-packages/skbuild/cmaker.py", line 496, in make
        raise SKBuildError(
    
    An error occurred while building with CMake.
      Command:
        cmake --build . --target install --config Release --
      Source directory:
        /tmp/pip-install-wvfldzt7/masterkeys
      Working directory:
        /tmp/pip-install-wvfldzt7/masterkeys/_skbuild/linux-x86_64-3.9/cmake-build
    Please see CMake's output for more information.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wvfldzt7/masterkeys/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wvfldzt7/masterkeys/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4wfkhqpw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/masterkeys Check the logs for full command output.

It says that first definition is in materkeys.c.o, so i presume is the objcect file from masterkeys.c, but actually there isn't that definition in there... no clue...

Unable to compile source (master branch)

Hi @RedFantom, I am trying to compile the tools so that I can get you the mapkeys for my keyboard but I am not able to even pass the first part.

BTW, before this, I was getting another cmake error (unable to find X11) which was solved by adding one extra dependency: libx11-dev. (I've just realized that this is because I was also compiling some examples, I commented that line but the error is still there, even after a clean)

gomera@deathscythe:~/projects/masterkeys-linux$ cmake .
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at libmk/CMakeLists.txt:5 (include):
  include could not find load file:

    FindLibUSB.cmake
Call Stack (most recent call first):
  CMakeLists.txt:6 (include)


-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
CMake Error at examples/ambilight/CMakeLists.txt:5 (include):
  include could not find load file:

    FindLibUSB.cmake
Call Stack (most recent call first):
  examples/CMakeLists.txt:7 (include)
  CMakeLists.txt:10 (include)


/usr/include
/usr/lib/x86_64-linux-gnu/libX11.so
-- Configuring incomplete, errors occurred!
See also "/home/gomera/projects/masterkeys-linux/CMakeFiles/CMakeOutput.log".

Information exchange regarding keyboard layout

Hey RedFantom,

it appears that we are working towards the same goal. I have mapped out and implemented large parts of the protocol used not only by the official SDK but also the control software itself.

I found your repository while trying to locate all MasterKeys models with their respective USB product IDs so that I may implement automatic layout detection, but this might be a dead end now, as both your ANSI Pro L and my ISO Pro L have the same USB product ID, 003b.

So what I am thinking now is that the layout information is encoded somewhere in the init exchange of the protocol that I have largely been unable to decipher. I know that the very first 01 02 ... exchange returns the firmware version in ASCII, but there's also some 40 20 ... package that I can't make sense of. This is the exchange I recorded during initialization:

>> 40 20 00 00 00 00 00 00   00 00 00 00 00 00 [00...]
<< 40 20 00 00 05 14 04 0c   12 01 20 00 00 00 [00...]

Since you are the only other person I know who has an ANSI Pro L, maybe we could compare these and find out which field, if any, is responsible for carrying the layout information?

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.