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

SDL2 caching event->DeviceId and event->source #2250

Closed
wants to merge 1 commit into from

Conversation

akshayaurora
Copy link
Member

@akshayaurora akshayaurora commented Jun 30, 2020

Credits https://hg.libsdl.org/SDL/rev/b5cd5e1e4440
Fixes kivy/kivy#6686, #1903, spesmilo/electrum#6276

Tested using the app provided in kivy/kivy#6686

from kivy.config import Config
Config.set('kivy', 'exit_on_escape', 'False')

from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenManager


Builder.load_string("""

<Main>:
    id: scr_mngr
    Screen:                           
        name: 'main'
        BoxLayout:
            orientation: "vertical"
            size_hint: 1,1
            pos_hint: {'top':1}
            Label:
                text: "Main Screen"
                size_hint: 1,.1
            Button:
                size_hint: 1,.1
                text: "Go Second Screen"
                on_press: root.go_second()
            Widget:
                
    Screen:                           
        name: 'second'
        BoxLayout:
            orientation: "vertical"
            size_hint: 1,1
            pos_hint: {'top':1}
            Label:
                text: "Second Screen"
                size_hint: 1,.1
            TextInput:
                size_hint: 1,.2
                text: "TextInput"
            Widget:
""")

class Main(ScreenManager):
    def __init__(self, **kwargs): 
        super(Main, self).__init__(**kwargs)
        Window.bind(on_keyboard = self.keyboard)
        
    def keyboard(self,window,key,*args):
        print(str(key))
        if key == 27:
            self.transition.direction  = "right"
            self.current = "main"
            
    def go_second(self,*args):
        self.transition.direction  = "left"
        self.current = "second"

class MyApp(App):    
    def build(self):
        return Main()

if __name__ == '__main__':
    MyApp().run()

@akshayaurora
Copy link
Member Author

The successful tests I did were when using API=27.

On further examination, it seems the issue was not present when using android.api=27 the default. This issue is only present when using api=28 and this simple changes does not fix the issue when using android.api=28.

Closing

@SomberNight
Copy link
Contributor

I have a new patch that works for me with API=28 for Electrum.
see SomberNight@c571db9
spesmilo/electrum#6276 (comment)

@akshayaurora
Copy link
Member Author

@SomberNight nice job, would you please do a pr for p4a too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextInput is blocking the keyboard listener for android back button
2 participants