GithubHelp home page GithubHelp logo

fwcd / antimicro Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ymmtmdk/antimicro

0.0 0.0 0.0 9.27 MB

Graphical program used to map keyboard buttons and mouse controls to a gamepad. Useful for playing games with no gamepad support

CMake 1.75% Roff 0.11% Batchfile 0.03% C++ 98.04% C 0.08%

antimicro's People

Contributors

7185 avatar aybe avatar burunduk avatar earnestly avatar emperorarthur avatar gitter-badger avatar haselkern avatar hasufell avatar jsbackus avatar lgbaldoni avatar ljrk0 avatar panzi avatar phob avatar rakuco avatar ryochan7 avatar sd65 avatar sir-maniac avatar tokyogeometry avatar zzpxyx avatar

Watchers

 avatar  avatar

antimicro's Issues

cannot build due to SDL2 missing package

I'm trying to build the project(after doing brew install qt sdl2 ), but getting:

[ 17%] Building CXX object CMakeFiles/antimicro.dir/src/main.cpp.o
In file included from /Users/anton/tmp/antimicro-macos-cursor-fix/src/main.cpp:54:
/Users/anton/tmp/antimicro-macos-cursor-fix/src/inputdevice.h:28:10: fatal error: 'SDL2/SDL_joystick.h' file not found
#include <SDL2/SDL_joystick.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/antimicro.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/antimicro.dir/all] Error 2
make: *** [all] Error 2

Mouse motion events on macOS

Currently, to generate native mouse events, both the new position and the delta offset are assigned to a CGEvent:

mouseLoc.x += xDis;
mouseLoc.y -= yDis;

CGEventSetIntegerValueField(move, kCGMouseEventDeltaX, xDis);
CGEventSetIntegerValueField(move, kCGMouseEventDeltaY, yDis);

Although the OS mouse pointer seems to respond to the absolute position, some OpenGL games (such as Minecraft) "capture" the mouse inside the window and apparently ignore the position vector. These, however, only process the delta offset, which results in the mouse pointer invisibly moving "below" the game window. This is problematic, because as soon as the user starts clicking (while the game is focused), the mouse pointer unexpectedly jumps outside of the game window to the location where the actual pointer has moved to.

The two "obvious" fixes to this problem each have their own issues:

  1. Remove this first code snippet. The mouse pointer will work fine inside the game, but not move at all outside of it.

  2. Remove the second code snippet. The mouse pointer will work fine on the desktop, but not move at all inside the game.

As the Quartz API does not seem to provide any lower-level support for mouse events, the best option might be to include a GUI checkbox under the mouse settings that allows the user to enable/disable this behavior if desired. This would, however, require a change to the event handling mechanism in order to deal with platform-specific settings.

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.