Answer the question
In order to leave comments, you need to log in
How to bring up the keyboard on android?
I am writing a pygame game for android. As you know, this framework does not provide ui, and you have to implement everything yourself. I needed an input that, when clicked, shows a custom keyboard and enters text. How can I call this keyboard through the android module or other modules?
I use rapt as pygame to android
Answer the question
In order to leave comments, you need to log in
You need to call the function pygame.key.start_text_input()
of the key module
Code example where the keyboard is called:
import pygame
pygame.init()
pygame.display.set_mode((600, 600))
clock = pygame.time.Clock()
FPS = 60
while 1:
for i in pygame.event.get():
if i.type == pygame.QUIT:
exit()
elif i.type == pygame.MOUSEBUTTONDOWN:
if i.button == 1:
#При нажатии кнопки мышки/пальцем по экрану вызывается клавиатура
pygame.key.start_text_input()
clock.tick(FPS)
pygame.display.update()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question