dimanche 19 juillet 2009

KCLEngine and evdev



Hi all,I started to work on KCL and it looks very powerfull now! KCLEngine read input information in a qthread using the evdev system.
Then KCL support all input device avaible for linux. Not only the keyboard, mouse and joystick... but a lot of other device like wiimote, webcam button etc....

Example of code using Virtual Button :
KCLEngine * kcl = new KCLEngine;
kcl->addInput(KCLEngine::MOUSE); //add first mouse detected
kcl->addInput(KCLEngine::KEYBOARD);//add standard keyboard

KCLInput * joystick = new KCLInput("/dev/input/event4");
kcl->addInput(joystick); //This is an other way to add an Input.


Now in the game mainLoop()
{

if (( kcl->button("MouseLeft") && ( kcl->button("Key_Right") && (kcl->button("JoyButton12"))
kDebug()<<"you made a combo!!!!";
}


So, other good feature with KCL, is that you can use more one mouse in the same time. (yes yes!!) I think you can imagine all the possibility, for example de multiplayer games on the same screen!
For example :

KCLMouse * mouse = KCLMouse("/dev/input/event4") //first mouse;
KCLMouse * mouse2 = KCLMouse("/dev/input/event6"); //second mouse


in the mainLoop
{
drawPoint(mouse.position());
drawPoint(mouse2.position());
}


So, now if you don't believe me, Look this video :

5 commentaires:

DrIDK a dit…

#gluon irc.freenode.net
JOIN AND HELP US!! ( web, c++, graphist, idea .. )

Mirza Dervisevic a dit…

Very very cool, two mouse on one screen, endless possibilities for game developers

jean-baptiste a dit…

Seems nice. Will it also support jog shuttle devices like contour shuttle ?

I would be interested to improve the support of these devices in Kdenlive video editor... regards

macslow a dit…

Nice, very nice! You do not happen to have any multi-touch input-devices you could test that with, do you?

Best regards ...

MacSlow

DrIDK a dit…

It works with multi touch device, if it supported by evdev