Browse Source

Do not configure console listener when no SSH connection

master
Krisjanis Rijnieks 9 years ago
parent
commit
b3ccb800d7
  1. 13
      src/Application/Application.cpp
  2. 1
      src/Application/Application.h

13
src/Application/Application.cpp

@ -18,6 +18,13 @@ Application::Application(){
ofAddListener(Gui::instance()->jointPressedEvent, this, &Application::onJointPressed);
ofAddListener(Gui::instance()->surfacePressedEvent, this, &Application::onSurfacePressed);
ofAddListener(Gui::instance()->backgroundPressedEvent, this, &Application::onBackgroundPressed);
string SSHConnection = ofSystem("if [ -z $SSH_CONNECTION ]; then echo no; else echo yes; fi");
if(SSHConnection == "yes"){
_isSSHConnection = true;
}else{
_isSSHConnection = false;
}
}
void Application::setup(){
@ -28,7 +35,9 @@ void Application::setup(){
}
}
if(_isSSHConnection){
consoleListener.setup(this);
}
}
ApplicationBaseState * Application::getState(){
@ -143,10 +152,6 @@ bool Application::isShiftKeyDown(){
}
void Application::onCharacterReceived(KeyListenerEventData & e){
return;
// TODO: Check if the same char is not comming through regular key event
ofKeyEventArgs args;
args.key = (int)e.character;

1
src/Application/Application.h

@ -79,6 +79,7 @@ class Application : public KeyListener {
Info _info;
bool _shiftKeyDown;
bool _isSSHConnection;
};

Loading…
Cancel
Save