30.11.2013 - New PICollection namespace, Android support, my own PIVector implementation

This commit is contained in:
peri4
2013-11-30 19:34:53 +04:00
parent ec5530053a
commit f50891b376
64 changed files with 5466 additions and 3392 deletions

View File

@@ -20,6 +20,22 @@
#include "pikbdlistener.h"
/** \class PIKbdListener
* \brief Keyboard console input listener
* \details This class provide listening of console keyboard input.
* There is two ways to receive pressed key:
* * external static functionwith format "void func(char key, void * data)"
* * event \a keyPressed()
*
* Also there is static variable \a exiting which by default is set to
* \b false. If \a enableExitCapture() was called and listener was started
* with function \a start(), this variable will be set to \b true if exit
* key will be pressed. By default exit key is 'Q' = shift + 'q'.
* To wait for this variable changes to \b true there is WAIT_FOR_EXIT macro
* \snippet pikbdlistener.cpp main
* */
bool PIKbdListener::exiting;
PIKbdListener::PIKbdListener(KBFunc slot, void * data_): PIThread() {
@@ -117,8 +133,10 @@ void PIKbdListener::run() {
PIKbdListener::exiting = true;
return;
}
keyPressed(lc, data);
if (ret_func != 0 && ret > 0) ret_func(lc, data);
if (ret > 0) {
keyPressed(lc, data);
if (ret_func != 0) ret_func(lc, data);
}
}