Programming the PS3 Controller for User Input - cell

I need to begin programming the input for the PS3 controller. Right now I'm working on the cell simulator and have been debugging code on there for some time now. I'm ready to move on to the next step of development which would be to get input from the user, specifically from the ps3 controller, but I have no idea how to start this or what libraries I need in order to do it.
If anyone could help me get started it would be much appreciated, thanks.

j00b, you can get input from gamepad using SDL joystick APIs. tried that myself with ps3 sixaxis controller, it works. i tried via usb only though, don't know if bluetooth gonna work.

Related

How do i prevent a mouse from sending input to DirectInput game?

This question was originally about how to trap mouse events, which i solved after a lot of research using SetWindowsHookEx with C++.
Problem is, its working for me on Windows, it works in applications, but it doesnt work in games.
can somebody help me understand why the mouse hook doesnt work in some games? could it be possible all the games i tried use Raw Input? :S
(i tried Ibb&Obb, Fallout 4, Metro Last Light and some other titles)
Basically im asking: how is it possible to use a Mouse Hook to trap it globally in all the applications running?
thanks for the helpers.
EDIT : I found out that most games i play use DirectInput. guess the better question is: How can i intercept mouse messages in DirectInput and prevent them from being registered by the game? i want to be able to drag the mouse and it would have no effect on the game.
after a lot of research i found out that, from what i understood, API Hooking (Microsoft Detours, API Hijack and more) is the only way to do it.
Important note: it doesnt help me much since API Hooking for games require DLL injection which will get you banned from Steam and other platforms.

How to create an application for receiving a video stream from a (WiFi) camera?

I am kind of a beginner in programming, learning it in school, so I really don't know much.
But I want to make a program for PC and maybe app for iPhone/Android that receives a video-stream from a camera and displays it, nothing more.
How do I do this in C++/C# in Visual Studio?
Camera -> WiFi -> PC/Phone
A good library for working with images/video in c++ is OpenCV. I would recommend taking a look at their examples.
http://docs.opencv.org/3.0.0/index.html
Check out the highgui module!
You should first check for cameras that come with a programming API so that it is easy to write programs to communicate with it.
If the camera drivers can make it communicate with standard chat apps like Sykpe, you should be able to use C++ and OpenCV to capture a stream from it. But you can choose the language and tools according to what you want to do with the video stream.

Low level programmatic keyboard emulation

I bought a physical button and hooked it up to my computer, using the Arduino it communicates over USB serial to a C++ program I'm writing. Now I want to make the button simulate a keypress on my computer so I could use it as an alternative controller for the games I play.
If you are not familiar with Arduino, don't mind it, my problem lies completely in C++
The solution for this is pretty simple, it basically boils down to using SendMessage to a window with keystrokes, or many alternative methods like sendKeys and what not.
I have tried every single library or windows function that could handle something like this, but none of them actually simulates a keystroke being pressed by a keyboard.
Everything I tried so far has worked in many programs like Notepad and Chrome but none works with a game that doesn't listen to windows messages to handle key input.
My guess is that these games use GetAsyncKeyState which is communicating with the physical keyboard in a direct manner.
How could I resolve this? What API provides such functionality?
I need something very low level here, maybe even a program that emulates a new keyboard so windows thinks I have plugged in a physical one.
This would help me ALOT I've encountered this problem numerous times and I will keep encountering it in the near future with other projects.
I hope someone can help,
Thanks!
Use keybd_event() or SendInput()

Mouse/Keyboard input in OSX without Cocoa

I am writing an application in C++ using CGL/OpenGL, and need keyboard/mouse input. I was trying to avoid Objective-C and Cocoa if possible. I am aware that one can capture input using Carbon, but seems that Carbon is slowly being phased out, plus it is not clear if it plays well with 64-bit applications. Does anybody know if there any other alternatives in OSX for mouse/keyboard input using C++ without going to something very low level (e.g. I/O kit)? Any code snippets to get me started?
Thank you-
Quartz event taps might do what you want. Without knowing why you are trying to avoid using the Cocoa event system it's hard to know what technology would be best for what you are trying to do.
Gaffer on Games wrote an article doing just what you want, context and surface creation with CGL and a minimal event loop (although it's a little out of date, for El Capitan you need CGLSetFullScreenOnDisplay())
http://gafferongames.com/2009/01/19/opengl-on-macosx/
It uses InstallApplicationEventHandler, one of the two keyboard APIs mentioned here:
Keyboard input on OSX

Controlling mouse in linux

Basically I'm currently using the wiiuse library to get the wiimote working on linux. I want to now be able to control the mouse through the IR readings.
Can somebody point me in the right direction as to how to approach this? I know of uinput but there doesn't seem to be a lot of tutorials/guides on the web.
I'm working with c/c++ so a library in c/c++ would be helpful.
Cheers.
I think you should look into "becoming" a new mouse device. This would require developing a device driver that knows how to read the Wii device, and present that data to the input system as if it came from a mouse. The Linux kernel supports multiple mice connected at the same time, and merges the inputs from all of them, so this will work fine.
This book might be a handy help along the way. Not sure if it's possible to do this totally in userland, but that is of course worth investigating too.
I`m not sure if I understood you question corectly. If looking for controling mouse pointer from userspace look at XTest Extension Usefull link
Edit:
From kernel POV uinput looks like good starting point
In the end I decided to just draw "cursor" objects on the screen and use setup each input device to control a separate "cursor" object. This seemed the best idea as we were short on time.