Example #1
0
static void
initialize(void *p)
{
    virtualkeyboard_request_events(0);
    virtualkeyboard_show();

    unsigned int surface_width, surface_height;
    glview_get_size(&surface_width, &surface_height);

    glShadeModel(GL_SMOOTH);

    glClearColor(1.0f, 1.0f, 1.0f, 1.0f);

    glViewport(0, 0, surface_width, surface_height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();

    glOrthof(0.0f, (float) (surface_width) / (float) (surface_height), 0.0f,
            1.0f, -1.0f, 1.0f);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    glTranslatef((float) (surface_width) / (float) (surface_height) / 2, 0.5f,
            0.0f);
}
void Platform::displayKeyboard(bool display)
{
    if (display)
        virtualkeyboard_show();
    else
        virtualkeyboard_hide();
}
Example #3
0
bool QBBVirtualKeyboardBps::showKeyboard()
{
#if defined(QBBVIRTUALKEYBOARD_DEBUG)
    qDebug() << Q_FUNC_INFO << "current visibility=" << isVisible();
#endif

    virtualkeyboard_show();
    return true;
}
bool QQnxVirtualKeyboardBps::showKeyboard()
{
    qVirtualKeyboardDebug() << Q_FUNC_INFO << "current visibility=" << isVisible();

    // They keyboard's mode is global between applications, we have to set it each time
    if ( !isVisible() )
        applyKeyboardOptions();

    virtualkeyboard_show();
    return true;
}
bool QBBVirtualKeyboardBps::showKeyboard()
{
#if defined(QBBVIRTUALKEYBOARD_DEBUG)
    qDebug() << Q_FUNC_INFO << "current visibility=" << isVisible();
#endif

    // They keyboard's mode is global between applications, we have to set it each time
    if (!isVisible())
        applyKeyboardMode(keyboardMode());

    virtualkeyboard_show();
    return true;
}
Example #6
0
void CCEGLView::showKeyboard()
{
	int height;

	virtualkeyboard_get_height(&height);

	float factor = m_fScaleY / CC_CONTENT_SCALE_FACTOR();
	height = (float)height / factor;

	CCRect rect_begin(0, 0 - height, m_obScreenSize.width / factor, height);
	CCRect rect_end(0, 0, m_obScreenSize.width / factor, height);

    CCIMEKeyboardNotificationInfo info;
    info.begin = rect_begin;
    info.end = rect_end;
    info.duration = 0;

    CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardWillShow(info);
    virtualkeyboard_show();
    CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardDidShow(info);
}
Example #7
0
void OSBB10::show_virtual_keyboard(const String& p_existing_text,const Rect2& p_screen_rect) {

	virtualkeyboard_show();
};
Example #8
0
void ShowKeyboard() {
	virtualkeyboard_show();
}
Example #9
0
void Keyboard_NDK::callKeyboardNumber(){

    virtualkeyboard_change_options(VIRTUALKEYBOARD_LAYOUT_NUMBER,VIRTUALKEYBOARD_ENTER_SEND);
    virtualkeyboard_show();
}
Example #10
0
void Keyboard_NDK::callKeyboardEmail(){
    virtualkeyboard_change_options(VIRTUALKEYBOARD_LAYOUT_EMAIL,VIRTUALKEYBOARD_ENTER_SEND);
    virtualkeyboard_show();
}
Example #11
0
int main(int argc, char *argv[])
{
    int exit_application = 0;

    screen_context_t screen_cxt;

    //Create a screen context that will be used to create an EGL surface to to receive libscreen events
    screen_create_context(&screen_cxt,0);

    //Use utility code to initialize EGL for 2D rendering with GL ES 1.1
    if (EXIT_SUCCESS != bbutil_init(screen_cxt, GL_ES_1)) {
    	bbutil_terminate();
        screen_destroy_context(screen_cxt);
        return 0;
    }

    //Initialize app data
    initialize();

    //Initialize BPS library
    bps_initialize();

    //Signal BPS library that navigator, screen, and keyboard events will be requested
    screen_request_events(screen_cxt);
    navigator_request_events(0);
    virtualkeyboard_request_events(0);

    virtualkeyboard_show();

    for (;;) {
    	//Request and process BPS next available event
        bps_event_t *event = NULL;
        if (bps_get_event(&event, 0) != BPS_SUCCESS)
        	return EXIT_FAILURE;

           if (event) {
                int domain = bps_event_get_domain(event);

                if (domain == screen_get_domain()) {
                    handleScreenEvent(event);
                } else if ((domain == navigator_get_domain()) && (NAVIGATOR_EXIT == bps_event_get_code(event)))  {
                	exit_application = 1;
                }
            }
            
            if (exit_application) {
                break;
            }
        render();
    }

    //Stop requesting events from libscreen
    screen_stop_events(screen_cxt);

    //Shut down BPS library for this process
    bps_shutdown();

    //Use utility code to terminate EGL setup
    bbutil_terminate();

    //Destroy libscreen context
    screen_destroy_context(screen_cxt);
    return 0;
}
Example #12
0
static void
event(bps_event_t *event, int domain, int code, void *p)
{
    if (virtualkeyboard_get_domain() == domain) {
        switch (code) {
        case VIRTUALKEYBOARD_EVENT_VISIBLE:
            keyboard_visible = true;
            break;
        case VIRTUALKEYBOARD_EVENT_HIDDEN:
            keyboard_visible = false;
            break;
        }
    } else if (screen_get_domain() == domain) {

        screen_event_t screen_event = screen_event_get_event(event);

        int screen_val;
        screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &screen_val);

        switch (screen_val) {
        case SCREEN_EVENT_MTOUCH_TOUCH:
            if (!keyboard_visible) {
                virtualkeyboard_show();
            }
            break;
        case SCREEN_EVENT_KEYBOARD:
            screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_FLAGS, &screen_val);

            if (screen_val & KEY_DOWN) {
                screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_SYM,&screen_val);

                fprintf(stderr, "The '%c' key was pressed\n", (char)screen_val);

                switch (screen_val) {
                case KEYCODE_I:
                    // Display the email layout with "Send" enter key
                    virtualkeyboard_change_options(VIRTUALKEYBOARD_LAYOUT_EMAIL, VIRTUALKEYBOARD_ENTER_SEND);
                    break;
                case KEYCODE_O:
                    // Display the phone layout with "Connect" enter key
                    virtualkeyboard_change_options(VIRTUALKEYBOARD_LAYOUT_PHONE, VIRTUALKEYBOARD_ENTER_CONNECT);
                    break;
                case KEYCODE_P:
                    // Display the default layout with default enter key
                    virtualkeyboard_change_options(VIRTUALKEYBOARD_LAYOUT_DEFAULT, VIRTUALKEYBOARD_ENTER_DEFAULT);
                    break;
                case KEYCODE_H:
                    // Hide the keyboard
                    virtualkeyboard_hide();
                    break;
                case KEYCODE_A:
                    // Increment rotation angle
                    angle = fmod(angle + ANGLE_INCREMENT, CIRCLE_DEGREES );
                    break;
                case KEYCODE_Z:
                    // Decrement rotation angle
                    angle = fmod(angle - ANGLE_INCREMENT, CIRCLE_DEGREES );
                    break;
                default:
                    break;
                }
            }
            break;
        }
    }
}