Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextInput Bug ( a -> l , 1 -> 9 , q -> o , z -> . etc ) #7627

Open
psalm505 opened this issue Sep 20, 2021 · 16 comments
Open

TextInput Bug ( a -> l , 1 -> 9 , q -> o , z -> . etc ) #7627

psalm505 opened this issue Sep 20, 2021 · 16 comments
Labels
Component: core-providers kivy/core Platform: Linux Priority: Medium Should be fixed for long-term health of project Type: Bug A bug or something not working as intended

Comments

@psalm505
Copy link

psalm505 commented Sep 20, 2021

* Python: 3.9.7

  • OS: Linux Fedra34
  • Kivy: 2.0.0

Next code can't receive correct character at all.
if you input 'a' , it receives 'l' ( small L ).
'1' then '9'
'q' then 'o'
etc.

How can I fix this?

from kivy.app			import App
from kivy.uix.textinput	import TextInput

class KivyApp(App):
	def build(self):
		return( TextInput() )

KivyApp().run()
@psalm505
Copy link
Author

Here is a log message on console...

[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_21-09-20_1.txt
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "/usr/local/lib64/python3.9/site-packages/kivy/init.py"
[INFO ] [Python ] v3.9.7 (default, Aug 30 2021, 00:00:00)
[GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[INFO ] [Python ] Interpreter at "/bin/python3"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b'4.6 (Compatibility Profile) Mesa 21.1.8'>
[INFO ] [GL ] OpenGL vendor <b'Intel'>
[INFO ] [GL ] OpenGL renderer <b'Mesa Intel(R) UHD Graphics 630 (CML GT2)'>
[INFO ] [GL ] OpenGL parsed version: 4, 6
[INFO ] [GL ] Shading version <b'4.60'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
[INFO ] [Clipboard ] Provider: xsel(['clipboard_xclip'] ignored)
[INFO ] [CutBuffer ] cut buffer support enabled
[INFO ] [Base ] Start application main loop
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Base ] Leaving application in progress...

@p0lygun
Copy link
Contributor

p0lygun commented Sep 20, 2021

@Psalm404
run this and provide screenshot and logs

from kivy.app import App
from kivy.lang.builder import Builder
from kivy.core.window import Window

kv = """
FloatLayout:
    TextInput:
        size_hint:0.5,0.5
        pos_hint:{'center_x':0.5,'center_y':0.5}
"""


class KivyApp(App):
    def build(self):
        Window.bind(on_key_down=lambda *x: print(x))
        return Builder.load_string(kv)


KivyApp().run()

@psalm505
Copy link
Author

Thank you Polygun.
I ran your code and I input 'a' 'b' 'c' 'd' 'e' 'f' 'g' in this order.

First screenshot is just after run your script,
and second screenshot is just after input these seven characters ( abcdefg ).

And I also copy and paste its log.
It seems that I can only input 'b' 'c' 'g' correctly, and these characters
are shown up on both screen and log message.

FYI: all of other applications on this PC works fine in terms of keyboad input.

I hope this answered your question.

Screenshot_2021-09-20_23-26-20
Screenshot_2021-09-20_23-27-05

[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_21-09-20_50.txt
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "/usr/local/lib64/python3.9/site-packages/kivy/init.py"
[INFO ] [Python ] v3.9.7 (default, Aug 30 2021, 00:00:00)
[GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[INFO ] [Python ] Interpreter at "/bin/python3"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [ImageLoaderFFPy] Using ffpyplayer 4.3.2
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_ffpyplayer
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b'4.6 (Compatibility Profile) Mesa 21.1.8'>
[INFO ] [GL ] OpenGL vendor <b'Intel'>
[INFO ] [GL ] OpenGL renderer <b'Mesa Intel(R) UHD Graphics 630 (CML GT2)'>
[INFO ] [GL ] OpenGL parsed version: 4, 6
[INFO ] [GL ] Shading version <b'4.60'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
[INFO ] [Clipboard ] Provider: xclip
[INFO ] [CutBuffer ] cut buffer support enabled
[INFO ] [Base ] Start application main loop
[INFO ] [GL ] NPOT texture support is available
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f9a1cf48d60>, 98, 5, 'b', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f9a1cf48d60>, 99, 6, 'c', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f9a1cf48d60>, 103, 10, 'g', [])
[INFO ] [Base ] Leaving application in progress...

@p0lygun
Copy link
Contributor

p0lygun commented Sep 20, 2021

a is not even in the on_key_press ? that is weird
how did u install kivy ? pip or from master ?
did u try reinstalling ?
and your using qwerty layout ? or something else (im not sure it affects anything but just asking)

@psalm505
Copy link
Author

Thank you Polygun.

I installed kivy by using pip3. ( # pip3 install kivy )
I also tried reinstalling kivy and found that the phenomena is the same.

I am using standard qwerty keyboad and there is no such problems on
all other programs including (linux) GUI x-teminal and (linux) CLI console.

( I attached its screenshot. ) I suspect this is caused by kivy layer.

Screenshot_2021-09-21_11-47-35

@p0lygun
Copy link
Contributor

p0lygun commented Sep 21, 2021

ok, can you please also provide Screenshot and logs for this too :)

from kivy.app import App
from kivy.lang.builder import Builder
from kivy.core.window import Window

kv = """
FloatLayout:
    TextInput:
        size_hint:0.5,0.5
        pos_hint:{'center_x':0.5,'center_y':0.5}
        keyboard_on_key_down : lambda *x: print(x)
"""


class KivyApp(App):
    def build(self):
        Window.bind(on_key_down=lambda *x: print(x))
        return Builder.load_string(kv)


KivyApp().run()

@psalm505
Copy link
Author

Thank you Polygun.
I appreciate your concern.

I ran your new code and I input 'a' 'b' 'c' 'd' 'e' 'f' 'g' in this order again.

First screenshot is just after run your script,
and second screenshot is just after input these seven characters ( 'abcdefg' ).
And I also copy and paste its log.

I hope this answered your question.

Screenshot_2021-09-21_13-12-47

Screenshot_2021-09-21_13-13-01

[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_21-09-21_0.txt
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "/usr/local/lib64/python3.9/site-packages/kivy/init.py"
[INFO ] [Python ] v3.9.7 (default, Aug 30 2021, 00:00:00)
[GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[INFO ] [Python ] Interpreter at "/bin/python3"
[INFO ] [Logger ] Purge log fired. Analysing...
[INFO ] [Logger ] Purge finished!
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [ImageLoaderFFPy] Using ffpyplayer 4.3.2
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_ffpyplayer
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b'4.6 (Compatibility Profile) Mesa 21.1.8'>
[INFO ] [GL ] OpenGL vendor <b'Intel'>
[INFO ] [GL ] OpenGL renderer <b'Mesa Intel(R) UHD Graphics 630 (CML GT2)'>
[INFO ] [GL ] OpenGL parsed version: 4, 6
[INFO ] [GL ] Shading version <b'4.60'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
[INFO ] [Clipboard ] Provider: xclip
[INFO ] [CutBuffer ] cut buffer support enabled
[INFO ] [Base ] Start application main loop
[INFO ] [GL ] NPOT texture support is available
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f2eaa017d60>, 98, 5, 'b', [])
(<kivy.core.window.Keyboard object at 0x7f2eaa02ea50>, (98, 'b'), 'b', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f2eaa017d60>, 99, 6, 'c', [])
(<kivy.core.window.Keyboard object at 0x7f2eaa02ea50>, (99, 'c'), 'c', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f2eaa017d60>, 103, 10, 'g', [])
(<kivy.core.window.Keyboard object at 0x7f2eaa02ea50>, (103, 'g'), 'g', [])
[INFO ] [Base ] Leaving application in progress...

@p0lygun
Copy link
Contributor

p0lygun commented Sep 21, 2021

are you in the discord server ? https://chat.kivy.org/

@psalm505
Copy link
Author

No, I am not.
But I created my account just now. ( psalm404 ).

@tshirtman
Copy link
Member

can you check in your ~/.kivy/config.ini (or typing f1 in the kivy app) if you have a different keymap set from what you expect?

@psalm505
Copy link
Author

Thank you tshirtman!
I appreciate your concerns!

I checked "~/.kivy/config.ini" following your advice,
and found that it is normal in terms of keyboad settings.

( I attached screenshot of it. )

All of other appication including Python3 can handle keyboad
input correctly so far... ( I am writing this text on the same computer. )

Screenshot_2021-09-21_19-54-58

@misl6
Copy link
Member

misl6 commented Sep 21, 2021

@Psalm404 Can you please check the SDL version that are you using?

@psalm505
Copy link
Author

Thank you misl6.
I appreciate your message and concerns.

I will check it now...

@psalm505
Copy link
Author

I checked it and found that I am using SDL2-2.0.16-2.fc34.x86_64 on my PC.

I also checked newer packages by OS command ( # dnf update ) just in case,
but it seems that there is no newer packages now for my OS ( Linux Fedora34 X86_64 )
I hope that this answers your questions.

@psalm505
Copy link
Author

I might find the cause or work around of this phenomena...
I will report it after some check.

@psalm505
Copy link
Author

This is the work aroud that I found so far.

If I bypass Ibus ( Intelligent Input Bus - which is one of Input Method ) keymap, I can input correct characters.
I confirmed and checked it out under this condition by using the script whch p0lygun suggested me.
-> I just input 'a' 'b' 'c' 'd' 'e' 'f' 'g' ( seven characters ) in this order.
( I attached this screenshot , log message, and script file. )

But if I re-use or re-enable Ibus keymap, this phenomena shows up again.
I confirmed and checked it out again under this bad condition by using the same script.
-> I also just input same 'a' 'b' 'c' 'd' 'e' 'f' 'g' ( seven characters ) in this order.
( I also attached bad screenshot and bad log message )

But all the other programs including Python never affect its settings...
I hope that this can be work around for you...

( Good Screenshot )
Screenshot_2021-09-21_20-49-38

( Good Logmessage )
[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_21-09-21_89.txt
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "/usr/local/lib64/python3.9/site-packages/kivy/init.py"
[INFO ] [Python ] v3.9.7 (default, Aug 30 2021, 00:00:00)
[GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[INFO ] [Python ] Interpreter at "/bin/python3"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [ImageLoaderFFPy] Using ffpyplayer 4.3.2
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_ffpyplayer
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b'4.6 (Compatibility Profile) Mesa 21.1.8'>
[INFO ] [GL ] OpenGL vendor <b'Intel'>
[INFO ] [GL ] OpenGL renderer <b'Mesa Intel(R) UHD Graphics 630 (CML GT2)'>
[INFO ] [GL ] OpenGL parsed version: 4, 6
[INFO ] [GL ] Shading version <b'4.60'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
[INFO ] [Clipboard ] Provider: xclip
[INFO ] [CutBuffer ] cut buffer support enabled
[INFO ] [Base ] Start application main loop
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f0e5ca04d60>, 97, 4, 'a', [])
(<kivy.core.window.Keyboard object at 0x7f0e5ca1ca50>, (97, 'a'), 'a', [])
[INFO ] [GL ] NPOT texture support is available
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f0e5ca04d60>, 98, 5, 'b', [])
(<kivy.core.window.Keyboard object at 0x7f0e5ca1ca50>, (98, 'b'), 'b', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f0e5ca04d60>, 99, 6, 'c', [])
(<kivy.core.window.Keyboard object at 0x7f0e5ca1ca50>, (99, 'c'), 'c', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f0e5ca04d60>, 100, 7, 'd', [])
(<kivy.core.window.Keyboard object at 0x7f0e5ca1ca50>, (100, 'd'), 'd', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f0e5ca04d60>, 101, 8, 'e', [])
(<kivy.core.window.Keyboard object at 0x7f0e5ca1ca50>, (101, 'e'), 'e', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f0e5ca04d60>, 102, 9, 'f', [])
(<kivy.core.window.Keyboard object at 0x7f0e5ca1ca50>, (102, 'f'), 'f', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f0e5ca04d60>, 103, 10, 'g', [])
(<kivy.core.window.Keyboard object at 0x7f0e5ca1ca50>, (103, 'g'), 'g', [])
[INFO ] [Base ] Leaving application in progress...

( Script file - Common )
from kivy.app import App
from kivy.lang.builder import Builder
from kivy.core.window import Window

kv = """
FloatLayout:
TextInput:
size_hint:0.5,0.5
pos_hint:{'center_x':0.5,'center_y':0.5}
keyboard_on_key_down : lambda *x: print(x)
"""

class KivyApp(App):
def build(self):
Window.bind(on_key_down=lambda *x: print(x))
return Builder.load_string(kv)

KivyApp().run()

( Bad Screenshot )
Screenshot_2021-09-21_20-50-38

( Bad Logmessage )
[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_21-09-21_90.txt
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "/usr/local/lib64/python3.9/site-packages/kivy/init.py"
[INFO ] [Python ] v3.9.7 (default, Aug 30 2021, 00:00:00)
[GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
[INFO ] [Python ] Interpreter at "/bin/python3"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [ImageLoaderFFPy] Using ffpyplayer 4.3.2
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_ffpyplayer
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b'4.6 (Compatibility Profile) Mesa 21.1.8'>
[INFO ] [GL ] OpenGL vendor <b'Intel'>
[INFO ] [GL ] OpenGL renderer <b'Mesa Intel(R) UHD Graphics 630 (CML GT2)'>
[INFO ] [GL ] OpenGL parsed version: 4, 6
[INFO ] [GL ] Shading version <b'4.60'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
[INFO ] [Clipboard ] Provider: xclip
[INFO ] [CutBuffer ] cut buffer support enabled
[INFO ] [Base ] Start application main loop
[INFO ] [GL ] NPOT texture support is available
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7ff836defd60>, 98, 5, 'b', [])
(<kivy.core.window.Keyboard object at 0x7ff836e07a50>, (98, 'b'), 'b', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7ff836defd60>, 99, 6, 'c', [])
(<kivy.core.window.Keyboard object at 0x7ff836e07a50>, (99, 'c'), 'c', [])
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7ff836defd60>, 103, 10, 'g', [])
(<kivy.core.window.Keyboard object at 0x7ff836e07a50>, (103, 'g'), 'g', [])
[INFO ] [Base ] Leaving application in progress...

Thank you for all

@tshirtman tshirtman added Component: core-providers kivy/core Platform: Linux Priority: Medium Should be fixed for long-term health of project Type: Bug A bug or something not working as intended labels Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: core-providers kivy/core Platform: Linux Priority: Medium Should be fixed for long-term health of project Type: Bug A bug or something not working as intended
Projects
None yet
Development

No branches or pull requests

4 participants