Coder Social home page Coder Social logo

wgois / ois Goto Github PK

View Code? Open in Web Editor NEW
256.0 31.0 87.0 2.66 MB

Official OIS repository. Object oriented Input System

Home Page: https://wgois.github.io/OIS/

License: zlib License

C 1.01% C++ 80.42% Objective-C 2.76% Objective-C++ 9.83% CMake 5.97% Shell 0.02%

ois's Introduction

OIS: Object oriented Input System

Software License Build status Build Status Maintenance PRs Welcome Packaging status latest packaged version(s)

Cross Platform Object Oriented Input Lib System. Meant to be very robust and compatible with many systems and operating systems.

Linux

Dependencies: X11

To build and install:

    cmake -H. -B./build
    cd ./build
    make
    make install

By default, the install target will install OIS.pc inside /usr/local/lib/pkgconfig. To find OIS with pkg-config, you need to have this directory on your PKG_CONFIG_PATH

    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Windows

Dependencies: DirectX SDK (now part of the Windows SDK)

For Visual Studio:

    cmake -H. -B./build
    msbuild "build\OIS.sln"

Or, simply open cmake-gui, and generate a visual studio solution in a few clicks.

OSX

For XCode:

(or use the graphical CMake tool)

    cmake -H. -B./build
    cd ./build
    make

On a 64bit mac, code will use Cocoa to interact with the input system.

License

The zlib/libpng License

Copyright (c) 2018-2021 Arthur Brainville, and GitHub contributors
Copyright (c) 2015 Andrew Fenn
Copyright (c) 2005-2010 Phillip Castaneda (pjcast -- www.wreckedgames.com)

This software is provided 'as-is', without any express or implied warranty. In no
event will the authors be held liable for any damages arising from the use of this
software.

Permission is granted to anyone to use this software for any purpose, including
commercial applications, and to alter it and redistribute it freely, subject to the
following restrictions:

    1. The origin of this software must not be misrepresented; you must not claim that
        you wrote the original software. If you use this software in a product,
        an acknowledgment in the product documentation would be appreciated
        but is not required.

    2. Altered source versions must be plainly marked as such, and must not be
        misrepresented as being the original software.

    3. This notice may not be removed or altered from any source distribution.

ois's People

Contributors

andrewfenn avatar azmeuk avatar bob-z avatar cxong avatar dagophil avatar davidjrogers avatar hymerman avatar intelligide avatar kreijstal avatar live627 avatar lucypero avatar lwmte avatar nolan778 avatar pmrochen avatar rassweiler avatar rpaciorek avatar sam-tak avatar session-zz avatar tbeu avatar theonlyjoey avatar thesamesam avatar ybalrid avatar zlondrej 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ois's Issues

InputManager::createInputObject(OIS::Mouse, false) crashes when mouse is not plugged in.

Describe the bug
When an application is launched without a valid 'MOUSE' device. the program crashes when calling InputManager::createInputObject(OIS::Mouse, false) (raising an exception)

To Reproduce
Just run an application without proper 'MOUSE' device.

Expected behavior
Do not crash.

Platform (please complete the following information):

  • OS: Windows (OGRE)
  • Backend: DirectInput
  • Version 1.4

Additional context
You could think silly about launching without any valid mouse, but some people using my apps only with a trackball device, not with a mouse.
Funny thing is that if I run the program with plugged in a mouse and unplugging out after initialize, the program runs well and actually can control the mouse cursor with trackball device!

No Keyboard Input on Cocoa OSX.

Describe the bug
I'm converting my Ogre3D based Carbon program over to a Cocoa program. My program is ran via a single thread main while() loop. OIS Mouse and Keyboard capture is in this loop. The mouse inputs work fine, but there is no keyboard input.

Seeing how Cocoa uses an event system, I took it that I needed to run the loop as a timer. My attempts at setting up a timer failed because Objective-C and me disagree. However I was able to get the event system to work in a do-while loop. Similar to how SDL, firefox, qt,wx etc do it with nextEventMatchingMask/sendEvent. The Main loop calls the input loop, the input loop nextEventMatchingMask/sendEvent's and loops while there is events. If there is an event, I call OIS mouse and keyboard capture.

The mouse works great. But once again, OIS fails to get any keyboard input. I can check the Cocoa event to see that there is a keydown. It dumps to log. But if I uncomment OIS's logging in CocoaKeyboard.mm KeyDown(NSEvent*)theEvent it does get that far with the proper characters.

To Reproduce
Eaisest way to duplicate my issue is to run http://wiki.ogre3d.org/Advanced+Ogre+Framework in Ogre 1.10.12 using Cocoa. Add the following function to the AppStateManager::Start function, just inside the while loop and remove the existing ois captures and call this function.

void  AppStateManager::osxLoop()
{
    @autoreleasepool
    {
        NSEvent* ev;
        do
        {
            ev = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES];
            
            if(ev)
            {
               if([ev type] == NSKeyDown)
                {
                    
                       OF::getSingletonPtr()->m_pLog->logMessage("Cocoa Key Down");
                }
                
                OF::getSingletonPtr()->m_pMouse->capture();
                OF::getSingletonPtr()->m_pKeyboard->capture();
                [NSApp sendEvent: ev];
            }
        }
        while(ev);
    }
}

Alternatively, if you just want to look at the stock driving code, you can find that here: http://wiki.ogre3d.org/Advanced+Ogre+Framework#AppStateManager.cpp

The main loop is in Start().

Expected behavior
OSX to read the keydowns.

Platform (please complete the following information):

  • OS: OS X 10.12
  • Backend: Cocoa
  • Version 1.5

Additional context
If there is a way to directly inject osx keyup and keydown events. That'd be a temporary work around. I may end up doing that in leu of a solution. Also if there is a way I must run my main loop in cocoa, that would be helpful information too.

CMake Configuration sometimes can't find DirectX

Describe the bug
CMake can't find DirectX as part as the Windows 10 SDK

To Reproduce
Attempt to configure build on a Windows 10 machine without the old DirectX SDK installed, but with the Windows 10 SDK

Expected behavior
Should just works

Platform (please complete the following information):

  • OS: Windows
  • Version: Current HEAD

Check for unimplemented APIs

I found one implementation where getAsKeyCode() wasn't implemented on the keyboard side. This method is pure virtual. Any backed that don't implement that method will just not compile.

I have to check what this method is actually supposed to do. Why a string -> OIS::KeyCode convertion needs to be platform dependent?

Wrong mapping of XBox 360 Controller

Hi.

I have been using OIS 1.4 and recently upgraded to 1.5.1
Now it turns out that the mapping of an XBOX360 controller is absolutely remapped in a totally random way as I see it.

I built the console example and it shows the same thing.

Version 1.4:

OIS Version: 1.4.0
Release Name: 1.4.0
Manager: Win32InputManager
Total Keyboards: 1
Total Mice: 1
Total JoySticks: 1
        Device: OISKeyboard Vendor: Win32InputManager
        Device: OISMouse Vendor: Win32InputManager
        Device: OISJoyStick Vendor: Controller (XBOX 360 For Windows)

Creating Joystick 1
        Axes: 5
        Sliders: 0
        POV/HATs: 1
        Buttons: 10
        Vector3: 0
Startup done... Hit 'q' or ESC to exit.

Controller (XBOX 360 For Windows). Button Pressed # 0

Version 1.5:

*** OIS Console Demo App is starting up... ***
OIS Version: 1.5.1
Release Name: 1.5.0
Manager: Win32InputManager
Total Keyboards: 1
Total Mice: 1
Total JoySticks: 1
        Device: OISKeyboard Vendor: Win32InputManager
        Device: OISMouse Vendor: Win32InputManager
        Device: OISJoyStick Vendor: Controller (XBOX 360 For Windows)

Creating Joystick 1
        Axes: 6
        Sliders: 0
        POV/HATs: 1
        Buttons: 12
        Vector3: 0
Startup done... Hit 'q' or ESC to exit.

Controller (XBOX 360 For Windows). Button Pressed # 8

Lets just start there. Axis are also remapped (triggers).
We see that a different number of buttons are reported.
But most importantly, button A response is different.

Anyone else experiencing this?

[Fixed] Can't compile on linux.

I execute ./bootstrap && ./configure && make and get the following error:

make[1]: Entering directory `/run/media/sergio/RAZIEL/OIS/src'
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../includes -I../includes -g -O2 -I/usr/X11R6/include -g -O2 -MT OISInputManager.lo -MD -MP -MF .deps/OISInputManager.Tpo -c -o OISInputManager.lo OISInputManager.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../includes -I../includes -g -O2 -I/usr/X11R6/include -g -O2 -MT OISInputManager.lo -MD -MP -MF .deps/OISInputManager.Tpo -c OISInputManager.cpp -fPIC -DPIC -o .libs/OISInputManager.o
In file included from OISInputManager.cpp:23:0:
../includes/OISInputManager.h:207:17: error: cannot declare parameter '' to be of abstract type 'OIS::InputManager'
InputManager& operator=(InputManager);
^
../includes/OISInputManager.h:38:19: note: because the following virtual functions are pure within 'OIS::InputManager':
class _OISExport InputManager
^
../includes/OISInputManager.h:174:16: note: virtual void OIS::InputManager::_initialize(OIS::ParamList&)
virtual void _initialize(ParamList &paramList) = 0;

Full listing of supported input protocols?

Is your feature request related to a problem? Please describe.
I was going around to see if there was an easy way to get controller input on various platforms and eventually came here via a link in the GAinput README. After just giving compilation a shot, I noticed that OIS immediately picked up on my DirectInput controller (Razer Raiju Ultimate). That's pretty great - but I had no idea OIS had DInput support, at all.

Describe the solution you'd like
Within the documentation, I'd love to see a listing of what is supported where. That way, one ought to be able to have a better understanding of the capabilities. I simply had taken a wild guess, and it paid off. But information in the README or the generated docs feel very, very sparse.

Describe alternatives you've considered
Whilst I'd love to see it added to the README, it might also just be enough to provide a SUPPORTED.md with a table of what is supported at which platform - and if this support could possibly be extended to other platforms.

Additional context
I am still in the prepwork, but I want to use sokol and lvgl to re-create the Playstation 3 XMB on PC and make it navigateable with a controller. Either to use it as a launcher for other apps, or just as a neat little view to drop on a low-powered PC like a Raspberry Pi and hook it up to a TV to have a nice interface for navigating. Therefore, I was "shopping" for controller input abstractions and came across this one here. :)

Basic Usage

Hello
Iโ€™ve been looking for a c++ library that can be used to detect keystrokes for a space invaders game using no gui I am doing for a class project. The problem I have is my professor wants the project to be compatible to run on Linux and windows. I recently came across your GitHub and seen your repository that looks like it will help, but I donโ€™t understand how to implement it into my project because I donโ€™t see any documentation.

LinuxKeyboard.cpp warning logging with OIS_WARN

LinuxKeyboard.cpp currently uses OIS_WARN , but it has no effect because it's defined to do nothing in OISException.h. Can we please have at least a cout log, a way to configure how to handle warnings? It's important for my project that we have diagnostics for linux.

Put a new website up

The wrecked games website doesn't exist anymore. It would be a good thing to use the GitHub pages system instead.
We have issues and PR's coments, and Freenode #OIS to discuss problems, so we don't need a forum anymore.
It would also be an easy way to put online some documentation generated with Doxygen.

Tag stable releases

Please tag stable releases corresponding to the SourceForge tarballs (for the sake of history and traceability).

Exception: "No devices match requested type" when trying to call createInputObject

After building OIS, I am encountering "No devices match requested type" exception when trying to createInputObject for either keyboard or joystick. While debugging, it seems that vendor optional argument always contains garbage instead of empty string.

I tried to force OIS source to always use empty string as vendor (ignoring an argument), but even if it creates both keyboard/joystick objects successfully, only keyboard works properly, while joystick has garbage data when looking at debug:

Clipboard 2

I suspect it's something related to building OIS itself using CMake/VS, but I tried both generating .sln in CMake, as well as building in VS directly, both x86 and x64 architecture.

I was trying to build OIS for Windows, using both VS2019 and VS2022, using latest OIS version (1.5.1).

Gamepad Rumble?

This framework supports force feedback but as it looks no rumble with XInput devices. In the code it looks like the FF part is skipped when an XInput device is detected. But there seems to be Rumble for the WII Mote? I think a gamepad lib must have rumble functions. Could this be implemented? I would like to replace SDL2 in my app with OIS.

Merging pull requests

Hi there,

Is there any chance to see some of the pull requests reviewed and merged?

Thanks in advance.

Building as static lib for VS 2015 gives a CMake error

Hello,

Bug description:
I am trying to build OIS on Windows 7 using the generator "Visual Studio 14 2015". Everything works fine if I leave all CMake Options on their default value. However, when I set OIS_BUILD_SHARED_LIBS to false, CMake fails with the following message:

CMake Error:
  Error evaluating generator expression:

    $<TARGET_PDB_FILE:OIS>

  TARGET_PDB_FILE is allowed only for targets with linker created artifacts.

Steps to reproduce:

git clone https://github.com/wgois/OIS
mkdir build
cd build
cmake -g "Visual Studio 14 2015" -DOIS_BUILD_SHARED_LIBS=0 ..\OIS

Expected behavior:
No CMake error.

Platform:

  • OS: Windows 7.
  • Backend: Not sure, probably DirectInput?
  • Version: Both latest master (commit 27c44b0) and release 1.5 fail, I did not test others.

Additional context:
I think the error comes from the following lines in CMakeLists.txt:

if(MSVC)
  install(FILES $<TARGET_PDB_FILE:OIS> DESTINATION bin OPTIONAL)
endif(MSVC)

According to the CMake documentation and this CMake issue, the TARGET_PDB_FILE is for linker PDB files, however, static libraries need compiler PDB files. I think it does not make sense to deploy those, so changing above if(MSVC) to the following may be a solution:

if(MSVC AND BUILD_SHARED_LIBS)
  install(FILES $<TARGET_PDB_FILE:OIS> DESTINATION bin OPTIONAL)
endif(MSVC AND BUILD_SHARED_LIBS)

Do you think this is a valid solution? If so, should I add a pull request for the fix?

Can't configure project with CMAKE [DirectX SDK error]

CMAKE says it can't find the DirectX SDK - I am using windows 10 and the SDK is supposedly already a part of Windows or am I wrong?

CMAKE output:

Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299.
The C compiler identification is MSVC 19.14.26428.1
The CXX compiler identification is MSVC 19.14.26428.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:68 (MESSAGE):
  Could not locate DirectX SDK on this system


Configuring incomplete, errors occurred!
See also "C:/Users/Julien/source/repos/NYNE/OGRE/OIS-build/CMakeFiles/CMakeOutput.log".

Non-Exclusive X11 Linux Mouse Is Offset

Describe the bug
This is a bug that I fixed in my own custom implementation of OIS back in 2013 or so. Giving the latest master a try, it remains.

On X11 Linux non-exclusive mouse (native/hardware mouse), the OS and ingame mouse positions are offset.

Software Mouse works perfectly fine.

Incorrect
The tip of the yellow arrow is where the game thinks the mouse is. The mouse cursor is the location of the hardware mouse.

To Reproduce
Compile the latest master for Linux. Create an Ogre3d SDL window. Use OIS in non-exclusive/hidden mouse mode. You'll find that the mouse positions don't match.

Expected behavior
The tip of the hardware mouse and the mouse position in the renderer window should match.

Correct
After my code fix, the two are aligned properly.

Platform (please complete the following information):

  • OS: Linux
  • Backend: X11
  • Version: 1.3 to Master.

Additional context
I already implemented a fix for this. I am not sure if the code quality is up to standard. It probably can be handled better/prettier. But I will put what I am using in a pull request anyway.

FreeBSD compatibility

This library should work properly on FreeBSD, relying on XLib or SDL.

Need to isolate the Linux-specific things from the build, and do some testing. (The current FreeBSD port of OIS 1.2 does this.)

Save Windows build artifacts

It would be nice to keep the DLL built by AppVeyor somewhere instead of trashing them as we are currently doing

Wayland support

This is a feature request for Wayland support.

In total, I feel there's very little that needs to be added/changed to support Wayland on Linux platform.

Needed changes:

  • CMake needs additional option to toggle Wayland support which would then only require XKB from X11 as it's still used by Wayland applications.
  • I think it would be more convenient to move src/linux into src/linux/x11 and duplicate into src/linux/wayland and then make CMake switch between different implementations based on configuration flag.
  • Instead of querying events directly, provide a pointer to wl_pointer_listener so applications can attach it on seat_capability events.
  • Keyboard events are handled very similarly to X11 (using XKB), only the listener registration is handled like mouse events in previous point.

Reference:

Doesn't bootstrap on Cygwin.

I've been building stuff on Cygwin for years without problems, but OIS really doesn't like me!

$ ./bootstrap
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: You should add the contents of the following files to 'aclocal.m4':
libtoolize: '/usr/share/aclocal/libtool.m4'
libtoolize: '/usr/share/aclocal/ltoptions.m4'
libtoolize: '/usr/share/aclocal/ltsugar.m4'
libtoolize: '/usr/share/aclocal/ltversion.m4'
libtoolize: '/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
aclocal: macro _LT_COMPILER_PIC' required but not defined aclocal: macro_LT_DECL_SED' required but not defined
aclocal: macro _LT_DECL_SED' required but not defined aclocal: macro_LT_FUNC_STRIPNAME_CNF' required but not defined
autoheader-2.69: error: AC_CONFIG_HEADERS not found in configure.ac
Useless use of /d modifier in transliteration operator at /usr/bin/automake-1.7
line 5985.
configure.ac: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE,
configure.ac: that aclocal.m4 is present in the top-level directory,
configure.ac: and that aclocal.m4 was recently regenerated (using aclocal).
configure.ac: installing ./install-sh' configure.ac: installing./mkinstalldirs'
configure.ac: installing ./missing' configure.ac:6: installing./config.guess'
configure.ac:6: installing ./config.sub' demos/Makefile.am: installing./depcomp'
/usr/share/automake-1.7/am/depend2.am: am__fastdepCXX does not appear in AM_COND
ITIONAL
/usr/share/automake-1.7/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL
src/Makefile.am:5: Libtool library used but LIBTOOL' is undefined src/Makefile.am:5: src/Makefile.am:5: The usual way to defineLIBTOOL' is to add `AC_PROG_LIBTOOL'

src/Makefile.am:5: to configure.ac' and runaclocal' and `autoconf' again.
/usr/share/automake-1.7/am/depend2.am: am__fastdepCXX does not appear in AM_COND
ITIONAL
/usr/share/automake-1.7/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL
/usr/share/automake-1.7/am/depend2.am: am__fastdepCXX does not appear in AM_COND
ITIONAL
/usr/share/automake-1.7/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL
/usr/share/automake-1.7/am/depend2.am: am__fastdepCXX does not appear in AM_COND
ITIONAL
/usr/share/automake-1.7/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL
configure.ac:7: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:8: error: possibly undefined macro: AM_CONFIG_HEADER
configure.ac:13: error: possibly undefined macro: AM_PROG_CC_C_O
configure.ac:15: error: possibly undefined macro: AM_PROG_LIBTOOL
configure.ac:28: error: possibly undefined macro: AC_PROG_LIBTOOL

Cygwin was fully up to date as of 2 days ago, and I have been using automake etc. for other projects for ages.

I need OIS as a dependency for Ogre.

Add the possibility to check if capslock/numlock are set via the modifier API

This issue was opened to pursue part of what was proposed in PR #14

Todo : implement for theses platforms

  • Linux Xorg keyboard
  • Windows keyboard
  • Mac (cocoa) keyboard

As a bonus, add this to older (legacy) platform still supported.

- [ ] Mac (Carbon) keyboard. **I cannot test this, I don't have access to a 32bit MacOS system

Build fail on multilib systems without LDFLAGS

OS: Slackware64-current

When building the OIS master on a multilib Slackware64-current it will fail to build during the linking stage because it is trying to use /usr/lib/libX11.so instead of the correct /usr/lib64/libX11.so.

This can be worked around by adding LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \ to the slackbuild, but is there a more complete solution so that this will not happen?

/bin/sh ../libtool  --tag=CXX   --mode=link g++  -g -O2 -release 1.4.0   -o libOIS.la -rpath /usr/lib64 OISInputManager.lo OISObject.lo OISEffect.lo OISJoyStick.lo OISKeyboard.lo OISForceFeedback.lo OISException.lo EventHelpers.lo LinuxInputManager.lo LinuxJoyStickEvents.lo LinuxForceFeedback.lo LinuxKeyboard.lo LinuxMouse.lo  -L/usr/X11R6/lib -lX11 
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib64/gcc/x86_64-slackware-linux/5.4.0/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-slackware-linux/5.4.0/crtbeginS.o  .libs/OISInputManager.o .libs/OISObject.o .libs/OISEffect.o .libs/OISJoyStick.o .libs/OISKeyboard.o .libs/OISForceFeedback.o .libs/OISException.o .libs/EventHelpers.o .libs/LinuxInputManager.o .libs/LinuxJoyStickEvents.o .libs/LinuxForceFeedback.o .libs/LinuxKeyboard.o .libs/LinuxMouse.o   -Wl,-rpath -Wl,/usr/lib64/../lib -Wl,-rpath -Wl,/usr/lib64/../lib -L/usr/X11R6/lib /usr/lib/libX11.so /usr/lib/libxcb.so /usr/lib/libXau.so /usr/lib/libXdmcp.so -ldl -L/usr/lib64/gcc/x86_64-slackware-linux/5.4.0 -L/usr/lib64/gcc/x86_64-slackware-linux/5.4.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-slackware-linux/5.4.0/../../../../x86_64-slackware-linux/lib -L/usr/lib64/gcc/x86_64-slackware-linux/5.4.0/../../.. /usr/lib64/../lib/libstdc++.so -lm -lc -lgcc_s /usr/lib64/gcc/x86_64-slackware-linux/5.4.0/crtendS.o /usr/lib64/gcc/x86_64-slackware-linux/5.4.0/../../../../lib64/crtn.o  -g -O2   -Wl,-soname -Wl,libOIS-1.4.0.so -o .libs/libOIS-1.4.0.so
/usr/lib/libX11.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:424: recipe for target 'libOIS.la' failed
make[1]: *** [libOIS.la] Error 1
make[1]: Leaving directory '/tmp/SBo/ois-v1-3/src'
Makefile:440: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Question about .lib: OIS.lib and OIS_d.lib

Hello!

Thank you very much for this repository. I am going forward with some tutorials for OGRE and situation has it that I would like to link libraries from OIS into the project.

I am building with CMAKE and make sure to export all files (resolve all symbols for Win) and still can't find the .lib files.

I am in the start of this journey so if you have guidance on how to get .lib I will be glad of your help. I will attach a print of the errorlist when building the OIS through MCVS.

errorlist

Add CI for mingw compiler

MinGW is building the Win32 codepath, but their compilers and libraries are different from Visual Studio in term of the accessible functions.

It is possible that a build that passes on Visual Studio doesn't work on MinGW. It has to be checked by hand.

We need to setup either an AppVeyor build configuration, or a cross-compiling MinGW build on Linux on Travis to build the code on MinGW

Mac OS code needs fixing

Apparently, current code attempt to instantiate an abstract class in the Cocoa code.

https://travis-ci.org/Ybalrid/OIS/jobs/357121093#L263

log:

[ 54%] Building CXX object CMakeFiles/OIS.dir/src/mac/MacKeyboard.cpp.o
[ 59%] Building CXX object CMakeFiles/OIS.dir/src/mac/MacMouse.cpp.o
[ 63%] Building CXX object CMakeFiles/OIS.dir/src/mac/CocoaInputManager.mm.o
/Users/travis/build/Ybalrid/OIS/src/mac/CocoaInputManager.mm:161:27: error: allocating an object of abstract class type 'OIS::CocoaKeyboard'
                obj = new CocoaKeyboard(this, bufferMode, mUseRepeat);
                          ^
/Users/travis/build/Ybalrid/OIS/includes/OISKeyboard.h:295:24: note: unimplemented pure virtual method 'getAsKeyCode' in 'CocoaKeyboard'
                virtual OIS::KeyCode getAsKeyCode(std::string str) = 0;
                                     ^
1 error generated.

OISInputManager.cpp:255: bad erase ?

OISInputManager.cpp:255] -> [OISInputManager.cpp:250]: (warning) Missing bounds check for extra iterator increment in loop.

Source code is

            mFactoryObjects.erase(i++);

OSX build error private copy constructor

On El Capitan, I have the xcodebuild output complaining about OIS::MouseEvent having a private constructor.


CompileC build/OIS.build/Release/OIS.build/Objects-normal/x86_64/OISInputManager.o /Users/phil/devel/OIS/src/OISInputManager.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/phil/devel/OIS/Mac/XCode-2.2
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=211 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.12 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-sign-conversion -Winfinite-recursion -Wmove -I/Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/OIS.hmap -I../../includes -I/Users/phil/devel/OIS/Mac/XCode-2.2/build/Release/include -I/Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/DerivedSources/x86_64 -I/Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/DerivedSources -F/Users/phil/devel/OIS/Mac/XCode-2.2/build/Release -include /Users/phil/devel/OIS/Mac/XCode-2.2/build/SharedPrecompiledHeaders/Carbon-bsvzxlcocmvpuvhfhyumruemjerc/Carbon.h -MMD -MT dependencies -MF /Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/Objects-normal/x86_64/OISInputManager.d --serialize-diagnostics /Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/Objects-normal/x86_64/OISInputManager.dia -c /Users/phil/devel/OIS/src/OISInputManager.cpp -o /Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/Objects-normal/x86_64/OISInputManager.o

CompileC build/OIS.build/Release/OIS.build/Objects-normal/x86_64/MacHelpers.o /Users/phil/devel/OIS/src/mac/MacHelpers.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/phil/devel/OIS/Mac/XCode-2.2
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=211 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.12 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-sign-conversion -Winfinite-recursion -Wmove -I/Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/OIS.hmap -I../../includes -I/Users/phil/devel/OIS/Mac/XCode-2.2/build/Release/include -I/Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/DerivedSources/x86_64 -I/Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/DerivedSources -F/Users/phil/devel/OIS/Mac/XCode-2.2/build/Release -include /Users/phil/devel/OIS/Mac/XCode-2.2/build/SharedPrecompiledHeaders/Carbon-bsvzxlcocmvpuvhfhyumruemjerc/Carbon.h -MMD -MT dependencies -MF /Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/Objects-normal/x86_64/MacHelpers.d --serialize-diagnostics /Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/Objects-normal/x86_64/MacHelpers.dia -c /Users/phil/devel/OIS/src/mac/MacHelpers.cpp -o /Users/phil/devel/OIS/Mac/XCode-2.2/build/OIS.build/Release/OIS.build/Objects-normal/x86_64/MacHelpers.o
In file included from /Users/phil/devel/OIS/src/mac/MacHelpers.cpp:24:
../../includes/mac/MacHelpers.h:83:92: error: field of type 'OIS::MouseEvent' has private copy constructor
        Mac_MouseStackEvent( MouseEvent event, MacEventType type,  MouseButtonID button) : Event(event), Type(type), Button(button) {}
                                                                                           ^
In file included from /Users/phil/devel/OIS/src/mac/MacHelpers.cpp:24:
In file included from ../../includes/mac/MacHelpers.h:29:
/Users/phil/devel/OIS/Mac/XCode-2.2/../../includes/OISMouse.h:91:3: note: declared private here
                MouseEvent(const MouseEvent&);
                ^
1 error generated.

Any way around this?

SDL2 Integration?

Hi, i've noticed this an revived fork of the good ol' OIS input system, which i've used in OGRE long ago. and i want to ask if there's SDL2 integration because my project already uses it for windowing and some utility functions, and i saw the codebase there's SDL support in the repo, but i can't find some option switch in the CMake files.

There's some SDL2 support on the works, or still WIP?
Thanks.

mouse is warped when it is initialized

When I start my OGRE/OIS application and call
InputManager::createInputObject(OIS::OISMouse, true),
the mouse jumps to the upper left corner of the display. This behavior is undesired, and I haven't been able to disable it.

I suspect it's this line of code:
https://github.com/wgois/OIS/blob/master/src/linux/LinuxMouse.cpp#L68-L69

    //Warp mouse inside window
    XWarpPointer(display,None,window,0,0,0,0, 6,6);

Is it possible to disable this? Maybe conditionally disable it if x11_mouse_hide == false?

Mingw Support

As it is, this can't be compiled with mingw, because mingw uses /mingw64/lib/ for the directx libraries.

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.