Switching screens with keyboards

I have implemented a custom roller that is used to display different options that can be chosen. I have attached an event handler to this roller such that, when you press enter on a option. it switching to the corresponding screen. using lv_screen_load_anim(main_menu_pages[selected], LV_SCR_LOAD_ANIM_MOVE_LEFT, 0, 0, false);.

But one of the screens that i have, is a login page that im currently trying to get working. And when you press enter on the roller to go to that page. the keyboard gets focused and instantly switches to number mode because the number mode button gets focused by default. (The reason i focus the keyboard, is because this UI is supposed to work on a device with now mouse/keyboard/touchpad. but just a little keypad (left right up down and confirm)

Code (settings.cpp)

#include "settings.hpp"

#include "lvgl.h"
#include "settings.events.hpp"
#include "src/core/lv_obj.h"
#include "src/core/lv_obj_event.h"
#include "src/core/lv_obj_pos.h"
#include "src/core/lv_obj_style.h"
#include "src/core/lv_obj_style_gen.h"
#include "src/font/lv_font.h"
#include "src/misc/lv_area.h"
#include "src/widgets/buttonmatrix/lv_buttonmatrix.h"
#include "src/widgets/keyboard/lv_keyboard.h"
#include "src/widgets/textarea/lv_textarea.h"

lv_obj_t* set_screen;
lv_obj_t* login_user_keyboard;
lv_obj_t* login_user_textarea;

auto settings_page_init() -> void
{
    set_screen = lv_obj_create(NULL);
    lv_obj_add_event_cb(set_screen, settings_event_handler, LV_EVENT_SCREEN_LOADED, NULL);
    if (!login_user_keyboard)
        login_user_keyboard = lv_keyboard_create(set_screen);

    // Create textarea first
    login_user_textarea = lv_textarea_create(set_screen);
    lv_textarea_set_placeholder_text(login_user_textarea, "Username..");
    lv_obj_set_style_text_color(login_user_textarea, lv_color_white(), LV_PART_TEXTAREA_PLACEHOLDER);
    lv_textarea_set_one_line(login_user_textarea, true);
    lv_obj_set_style_border_color(login_user_textarea, lv_color_white(), 0);
    lv_obj_set_style_border_width(login_user_textarea, 1, 0);
    lv_obj_set_style_border_side(login_user_textarea, LV_BORDER_SIDE_BOTTOM, LV_PART_MAIN);
    lv_obj_set_style_pad_all(login_user_textarea, 0, 0);
    lv_obj_set_style_text_align(login_user_textarea, LV_TEXT_ALIGN_CENTER, LV_PART_TEXTAREA_PLACEHOLDER);
    lv_obj_align_to(login_user_textarea, login_user_keyboard, LV_ALIGN_OUT_TOP_MID, 0, 0);
    lv_obj_add_event_cb(login_user_textarea, settings_username_area_handler, LV_EVENT_KEY, NULL);
    lv_keyboard_set_textarea(login_user_keyboard, login_user_textarea);
    lv_keyboard_set_mode(login_user_keyboard, LV_KEYBOARD_MODE_TEXT_UPPER);
    lv_obj_set_state(login_user_keyboard, LV_STATE_FOCUSED, true);
}

Code (settings.events.cpp)

#include "settings.events.hpp"

#include "lvgl.h"
#include "main_menu/main_menu.hpp"
#include "settings.hpp"
#include "src/indev/lv_indev.h"
#include "src/widgets/keyboard/lv_keyboard.h"
auto settings_event_handler(lv_event_t* e) -> void
{
    lv_event_code_t event_code = lv_event_get_code(e);
    lv_key_t key = (lv_key_t)lv_event_get_key(e);
    LV_LOG_USER("You pressed key inside settings: %d", key);

    if (event_code == LV_EVENT_SCREEN_LOADED)
    {
        LV_LOG_USER("LOADED SETTINGS PAGE");
        lv_keyboard_set_textarea(login_user_keyboard, login_user_textarea);
        lv_obj_remove_flag(login_user_keyboard, LV_OBJ_FLAG_HIDDEN);
        lv_keyboard_set_mode(login_user_keyboard, LV_KEYBOARD_MODE_TEXT_LOWER);
        lv_group_focus_obj(login_user_keyboard);
    }
    if (event_code == LV_EVENT_FOCUSED)
    {
        LV_LOG_USER("KEYBOARD FOCUSED");
    }
}

auto settings_username_area_handler(lv_event_t* e) -> void {}

Does anyone know if there is a smarter way to go about switching screens like this maybe?
I feel like im not doing this the most optimal way.

auto init_pages() -> void {
    mains_voltages_init();
    settings_page_init();
    currents_page_init();
    power_page_init();
    alarm_warning_page_init();
    freq_page_init();
    main_menu_init();
}

auto main() -> int {
    lv_init();
    hal_init();
    add_static();
    lv_translation_set_language(LANGUAGE);
    init_pages();
    lv_screen_load_anim(mm_screen, LV_SCR_LOAD_ANIM_MOVE_LEFT, 0, 0, true);

    while (1) {
        lv_timer_handler();
        // custom_roller_get_selected_str((lv_obj_t*) custom_roller, selected_str, sizeof(selected_str));
        // std::cout << "Selected Value: " << selected_str << std::endl;
        usleep(5 * 1000);
    }

    return 0;
}

This is btw, my main function where i initialize all the pages first.