Skip to content

Commit

Permalink
Removed debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Nov 27, 2024
1 parent d32ed1c commit dcab662
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 4 additions & 8 deletions Sources/nCine/Backends/Android/AndroidInputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,15 @@ namespace nCine
if (textInputEvent_.length > 0) {
inputEventHandler_->OnTextInput(textInputEvent_);
}
LOGW("ANDROIDKEY TEXT 1: %i | %i | %s", keyCode, unicodeKey, String(textInputEvent_.text, textInputEvent_.length).data());
} else {
const int unicodeKey = keyEvent.getUnicodeChar(metaState);
LOGW("ANDROIDKEY TEXT 2: %i | %i", keyCode, unicodeKey);
}
}
break;
case AKEY_EVENT_ACTION_MULTIPLE:
if (keyboardEvent_.sym != KeySym::UNKNOWN) {
inputEventHandler_->OnKeyPressed(keyboardEvent_);
} else if ((metaState & AMETA_CTRL_ON) == 0) {
}
// TODO: This section doesn't work with software keyboards
/*else if ((metaState & AMETA_CTRL_ON) == 0) {
// Unicode input from software keyboard
long long int downTime = AKeyEvent_getDownTime(event);
long long int eventTime = AKeyEvent_getEventTime(event);
Expand All @@ -468,7 +466,6 @@ namespace nCine
AndroidJniClass_KeyEvent keyEvent(downTime, eventTime, action, keyCode, repeatCount, metaState, deviceID, keyboardEvent_.scancode, flags, source);
textInputEvent_.length = keyEvent.getCharacters(textInputEvent_.text, sizeof(textInputEvent_.text));
LOGW("ANDROIDKEY MULTI CHARS: %i | %s", textInputEvent_.length, String(textInputEvent_.text, textInputEvent_.length).data());
if (textInputEvent_.length > 0) {
inputEventHandler_->OnTextInput(textInputEvent_);
} else if (keyEvent.isPrintingKey() || keyCode == AKEYCODE_SPACE) {
Expand All @@ -477,9 +474,8 @@ namespace nCine
if (textInputEvent_.length > 0) {
inputEventHandler_->OnTextInput(textInputEvent_);
}
LOGW("ANDROIDKEY MULTI CHARS TEXT: %i | %i | %s", keyCode, unicodeKey, String(textInputEvent_.text, textInputEvent_.length).data());
}
}
}*/
break;
}

Expand Down
3 changes: 0 additions & 3 deletions Sources/nCine/Backends/Android/AndroidJniHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ namespace nCine
AndroidJniClass_KeyEvent::AndroidJniClass_KeyEvent(long long int downTime, long long int eventTime, int action, int code, int repeat, int metaState, int deviceId, int scancode, int flags, int source)
{
jobject javaObject = AndroidJniHelper::jniEnv->NewObject(javaClass_, midConstructor2_, downTime, eventTime, action, code, repeat, metaState, deviceId, scancode, flags, source);
LOGW("ANDROIDKEY NEW: %p | %i | %i | %i | %i", javaObject, code, scancode, metaState, flags);
javaObject_ = AndroidJniHelper::jniEnv->NewGlobalRef(javaObject);
}

Expand All @@ -526,14 +525,12 @@ namespace nCine

if (strCharacters) {
const char* characters = AndroidJniHelper::jniEnv->GetStringUTFChars(strCharacters, 0);
LOGW("ANDROIDKEY getCharacters: %s", characters);
length = std::min((std::int32_t)strlen(characters), maxStringSize);
std::memcpy(destination, characters, length);
AndroidJniHelper::jniEnv->ReleaseStringUTFChars(strCharacters, characters);
AndroidJniHelper::jniEnv->DeleteLocalRef(strCharacters);
} else {
length = 0;
LOGW("ANDROIDKEY getCharacters NONE");
}

return length;
Expand Down

0 comments on commit dcab662

Please sign in to comment.