Тёмный
No video :(

Kivy Tutorial #7 - Touch Input/Mouse Input 

Tech With Tim
Подписаться 1,6 млн
Просмотров 128 тыс.
50% 1

In this kivy tutorial 2019 I talk about getting user input such as touch input and input from the mouse. This way of getting input will work on all devices (phone, computer etc.).
Text-Based Tutorial: techwithtim.ne...
Kivy Docs: kivy.org/doc/s...
**************************************************************
WEBSITE: techwithtim.net
proXPN VPN: secure.proxpn....
Use the Code "SAVE6144" For 50% Off!
One-Time Donations: goo.gl/pbCE9J
Support the Channel: / techwithtim
Podcast: anchor.fm/tech...
Twitter: / techwithtimm
Join my discord server: / discord
**************************************************************
Please leave a LIKE and SUBSCRIBE for more content!
Tags:
- Tech With Tim
- Kivy tutorial
- Input kivy
- Python kivy tutorial
- kivy input
- Python Tutorials

Опубликовано:

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 71   
@almog12345678
@almog12345678 4 года назад
Hello Tim, great video. Just wanted to add. When you override the on touch method, you should add the super().on_touch_down(touch). So it will add all the implementations of touching that the kivy use anyway. If you add the button opacity it does not really click it, and won't call the command of the button(on_press). And with what you do, it will "click" the button any time the on_touch_down() method, no matter where on the screen.
@jamesberesford7310
@jamesberesford7310 3 года назад
Hey how would this work? I tried... def on_touch_down(self, touch): super().on_touch_down(touch) self.btn.background_color = RGB = .3, -.5, 1, 1 self.btn.color = RGB = 1, 1, 1, 1 But the accuracy of the click is still not on the button? Thanks in advance
@Elias-qx1zb
@Elias-qx1zb 2 года назад
@@jamesberesford7310 def on_touch_down(self, touch): print("Mouse Down", touch) super().on_touch_down(touch)
@zuzanaschulmeisterova
@zuzanaschulmeisterova 2 года назад
Then I have to do it for every function where I want to add some kind of functionality, am I right?
@rudyNok
@rudyNok 2 года назад
@@zuzanaschulmeisterova Áno.
@griffinneal4267
@griffinneal4267 2 года назад
@@Elias-qx1zb Thank you! I'm so glad I found your comment. I having been suffering for hours because of this small issue
@ComicRage
@ComicRage 5 лет назад
These tutorials keep getting better and better, thank you.
@user-pp6mm5eo7d
@user-pp6mm5eo7d 4 года назад
Thank You Tim for your tutorials..... I love your tutorials being so straight to the point and so promising to the viewer..... And I love the idea of that full GUI application
@maxharlan6982
@maxharlan6982 3 года назад
Thanks for this one Tim! Just got the homescreen layout of my first app done, looking forward to seeing how to make multiple pages link together!
@xskodemedia746
@xskodemedia746 5 лет назад
yeah, i really like your tutorials!!! I second your idea of doing a full GUI application!!
@DOTAFRICA
@DOTAFRICA 2 года назад
Thx for your time and effort bro Your really making life easier for alot of people!!
@jamesberesford7310
@jamesberesford7310 3 года назад
To deal with the opacity change, I found adding this to the .kv file code works.... (But instead of opacity I played with colours, but I think to do the opacity, you would just use btn.opacity=0.4, etc... - Happy to answer any qu's!) Button: text: "Goodbye world" size_hint: .2, .2 pos_hint: {"x": 0.4, "top": 0.4} background_normal: "" background_color: .3, 1, -.7, 1 id: btn2 on_press: print("Pressed button 2") btn2.background_color = RGB = 1, -1, -.7, 1 on_release: print("Released button 2") btn2.background_color = RGB = .3, 1, -.7, 1
@MrBizarre6000
@MrBizarre6000 3 года назад
hey my button's position and size is not changing after this touch method can you help?
@commonsence5746
@commonsence5746 4 года назад
Looking for ideas? I've got one. Lets make a temperature controller GUI to turn a relay on and off based on setpoint and current temprerature
@davidjohnmorandarte2764
@davidjohnmorandarte2764 2 года назад
Thanks for this bro, really Helpful stuff
@ndnlejuste
@ndnlejuste 9 месяцев назад
Thanks
@tomasgonzalez4819
@tomasgonzalez4819 5 лет назад
These are very promising tutorials in that you give us, the viewer, a really good idea of where we can go with kivy! Thx. With regard to ideas, how about a tutorial where you create a simple text messaging / chat mobile app with a login and deployment to the Play Store?
@TheJoshuatuqvq
@TheJoshuatuqvq 5 лет назад
Why does the button get pressed if you press anywhere on the screen (i.e. outside of the button too)?
@StephanvanIngen
@StephanvanIngen 4 года назад
Because the Widget-on_touch_down-method was overwritten, not the method of the button inside.
@rimantasri4578
@rimantasri4578 4 года назад
The further these series are going, the less there are viewers and likes of the videos :(
@srinivassagit2573
@srinivassagit2573 5 лет назад
Thank you for the video bro! Can you explain about long press,single tap,double tap and triple tap in kivy with example related to android touch events?
@Schadowshame
@Schadowshame 2 года назад
just call the super function to get the "on_touch_XXX" working class Touch(Widget): btn = ObjectProperty(None) def on_touch_down(self, touch): print("Mouse Down", touch) return super(Touch, self).on_touch_down(touch) def on_touch_move(self, touch): print("Mouse Move", touch) return super(Touch, self).on_touch_move(touch) def on_touch_up(self, touch): print("Mouse Up", touch) return super(Touch, self).on_touch_up(touch)
@jesseliverless9811
@jesseliverless9811 4 года назад
When I click anywhere else from the button (so in the black portion of the kivy app window, I also get the mouse events triggering and the print statements in the console. How do we prevent that?
@StephanvanIngen
@StephanvanIngen 4 года назад
That happened because the Widget-on_touch_down-method was overwritten, not the method of the button inside. So if you make a class for the button in the python-code (and use that defined in the .kv-file), you can override that method's on_touch*-methods...
@sainco3036
@sainco3036 5 лет назад
thanks.
@TechWithTim
@TechWithTim 5 лет назад
Np!
@gopalmondal9078
@gopalmondal9078 3 года назад
Whenever I am using the ontouch move function then the button is not pressable so how can I solve this
@atharvasaney3376
@atharvasaney3376 3 года назад
how do i do this: 1. user will type some input (can be anything for eg username) 2. after clicking submit, the username will be printed on the kivy app itself, inside another box please help
@nitishkhanna9368
@nitishkhanna9368 4 года назад
I tried using the function "on_touch_down" under Gridlayout and it still works although I haven't imported the Widget class. Can anyone help me understand what I got wrong here?
@nicksonkiprotich3368
@nicksonkiprotich3368 4 года назад
question: How can i access the volume_up button of an Android phone in kivy?i want a way that i can trigger an event even when my screen is off...anyone?
@juanluisruizbrox174
@juanluisruizbrox174 4 года назад
I dont know why i could spot red dots and move them , not the coordinates thing
@tom.shanghai
@tom.shanghai 3 года назад
when i click with the right mouse it makes red dots, the left one works haha
@Felix-vu9tz
@Felix-vu9tz 3 года назад
i had the same issue, i fixed by changing the the return method to Touch instead of FloatLayout
@adhikarlasridhar9383
@adhikarlasridhar9383 5 лет назад
Can you please make a tutorial on adding plots to a kivy app?
@lakshmivallabh1340
@lakshmivallabh1340 2 года назад
Awesome and really needed bro thanks. But 1 doubt bro, I want to block the all the touch functions temporarily when some content is loading like, I have added an MDSpinner when its fetching some details from database and at that time, I don't want my users to type in the text fields or click the buttons on the screen. So, how can we do that?
@manojganesh1706
@manojganesh1706 3 года назад
Can't we use pynput library instead and my app crashes? what should i do? i even gave the library in the requirements also while converting kv to apk but i still get error? Pls tell me how to use python libraries for creating apps.
@antoniofuller2331
@antoniofuller2331 3 года назад
I just hope that I'm not lazy
@user-kp8hx1mf8i
@user-kp8hx1mf8i 3 года назад
Everyone does the paint example, nobody demonstrates how to modify an existing application with working buttons for a touch screen. Anyone know any good resources for accomplishing this?
@MrBizarre6000
@MrBizarre6000 3 года назад
hey my button's position and size is not changing after this touch method can you help?
@saleemaboassi6140
@saleemaboassi6140 2 года назад
i 've got the same error
@alondradominguez2233
@alondradominguez2233 3 года назад
Do you have videos about how to do these things but without using kivy language? it's just that I have problem with kivy language and I tried to do the things you have done in a file .py but it doesn't work, I guessed I just don't know enough how to do it.
@NahidAhmedMansuri
@NahidAhmedMansuri 5 лет назад
Thanks a ton Tim for these awesome series....i wanted to see how i can deploy these apps to android or ios phone. How about an app which does data visualization using python's matplotlib ?
@TechWithTim
@TechWithTim 5 лет назад
Hey so I’ve been attempting to do so but I’m having a ton of difficulty, they don’t make it easy. Assuming I figure it out one day I will post a video
@NahidAhmedMansuri
@NahidAhmedMansuri 5 лет назад
@@TechWithTim I ll share with you if I figure that out..cheers!
@samsepoil5408
@samsepoil5408 4 года назад
Did you figure it out?
@jamesberesford7310
@jamesberesford7310 3 года назад
@@NahidAhmedMansuri Did you figure it out?
@NahidAhmedMansuri
@NahidAhmedMansuri 3 года назад
Hi guys...I did try this one a year ago and using Ubuntu could generate the apk which got deployed to Android and it worked
@Hiiii138
@Hiiii138 4 года назад
Sir I am using Jupyter notebook. How can I create.kv file here? Waiting for your reply..
@nikanorsakaria1704
@nikanorsakaria1704 3 года назад
Make a video Creating a Desktop App or Android with Python , where you include functional contact details, some photos in it and text , should be three pages atleast ,,, it might be helpful when doing my project
@anandsuralkar2947
@anandsuralkar2947 5 лет назад
Plz try to make a kivi app to run ur pygame
@joakimjocka8022
@joakimjocka8022 4 года назад
i think you need to update this , i copied it word for word and its just showing black , no button at all an also no spos updates
@niteshsharma3573
@niteshsharma3573 4 года назад
Hey! i made a game with ursina engine, which is made up on panda3d, but it do not work for android devices. How can i convert my game to an apk file?
@levrence8888
@levrence8888 5 лет назад
dope
@kingrut69
@kingrut69 5 лет назад
No name 'Property' in module 'kivy.properties'pylint(no-name-in-module) I keep getting this error, I'm not sure why.
@jonathanpichel4606
@jonathanpichel4606 5 лет назад
Just ignore it. I've heard that it may be that pylint has a few problems with cythonized modules like kivy. Just add at the end of the line #pylint: disable=no-name-in-module if you want it to stop showing up.
@gabemorris5370
@gabemorris5370 3 года назад
Does it bother anybody else that he leaves the "import kivy" when it never gets used?
@yassinezanned8187
@yassinezanned8187 3 года назад
Yes, you're right hhhhhh
@satoshinakamoto171
@satoshinakamoto171 3 года назад
i have corona . :(
@user-yx8yg1kc3d
@user-yx8yg1kc3d 5 лет назад
we want real apps
@adam120yep5
@adam120yep5 3 года назад
bruh just step by step to learn and then make your 'real apps'
@Uploadnamess
@Uploadnamess 5 лет назад
We write this but we not convert to apk 😂
@TechWithTim
@TechWithTim 5 лет назад
just wait friend
@Uploadnamess
@Uploadnamess 5 лет назад
@@TechWithTim Wishing Not To Wait A Long Expectation :D
Далее
Kivy Tutorial #8 - Simple Drawing App (Using Canvas)
8:01
The Truth About Learning Python in 2024
13:05
Просмотров 60 тыс.
💀СЛОМАЛ Айфон за 5 СЕКУНД😱
00:26
2 YEARS of PYTHON Game Development in 5 Minutes!
4:54
Просмотров 900 тыс.
Kivy Tutorial #9 - Navigation Between Multiple Screens
10:04
If __name__ == "__main__" for Python Developers
8:47
Просмотров 397 тыс.
How To Practice Programming So You Actually Get Good
15:46