久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <i id='SGoQf'><tr id='SGoQf'><dt id='SGoQf'><q id='SGoQf'><span id='SGoQf'><b id='SGoQf'><form id='SGoQf'><ins id='SGoQf'></ins><ul id='SGoQf'></ul><sub id='SGoQf'></sub></form><legend id='SGoQf'></legend><bdo id='SGoQf'><pre id='SGoQf'><center id='SGoQf'></center></pre></bdo></b><th id='SGoQf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='SGoQf'><tfoot id='SGoQf'></tfoot><dl id='SGoQf'><fieldset id='SGoQf'></fieldset></dl></div>
      1. <tfoot id='SGoQf'></tfoot>

        <small id='SGoQf'></small><noframes id='SGoQf'>

        <legend id='SGoQf'><style id='SGoQf'><dir id='SGoQf'><q id='SGoQf'></q></dir></style></legend>
          <bdo id='SGoQf'></bdo><ul id='SGoQf'></ul>

        您如何使用 kivy 檢查鍵盤事件?

        How do you check for keyboard events with kivy?(您如何使用 kivy 檢查鍵盤事件?)

          • <legend id='9VKag'><style id='9VKag'><dir id='9VKag'><q id='9VKag'></q></dir></style></legend>
              <tbody id='9VKag'></tbody>
          • <small id='9VKag'></small><noframes id='9VKag'>

                <i id='9VKag'><tr id='9VKag'><dt id='9VKag'><q id='9VKag'><span id='9VKag'><b id='9VKag'><form id='9VKag'><ins id='9VKag'></ins><ul id='9VKag'></ul><sub id='9VKag'></sub></form><legend id='9VKag'></legend><bdo id='9VKag'><pre id='9VKag'><center id='9VKag'></center></pre></bdo></b><th id='9VKag'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9VKag'><tfoot id='9VKag'></tfoot><dl id='9VKag'><fieldset id='9VKag'></fieldset></dl></div>
                  <bdo id='9VKag'></bdo><ul id='9VKag'></ul>
                  <tfoot id='9VKag'></tfoot>

                • 本文介紹了您如何使用 kivy 檢查鍵盤事件?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  所以,不久前,我開始自學(xué) kivy.我從主要的 kivy 網(wǎng)站開始,瀏覽了它的 pong 制作教程,完成后我決定嘗試給它關(guān)鍵輸入.我似乎找不到任何關(guān)于 kivy 鍵輸入的指南!任何人都知道某種教程或可以提供一些易于理解的代碼?我確實(shí)在 kivy 的示例文件夾中查看了鍵盤偵聽器,但如果我應(yīng)該使用它,我不太確定如何使用它.

                  So, awhile ago, I started teaching myself kivy. I started with the main kivy website and went through its pong making tutorial and upon finishing that I decided to try and give it key input. I just can't seem to find any kind of guide to key input with kivy! Anyone know some kind of tutorial or can provide some easy to understand code? I did look at the Keyboard Listener in the examples folder of kivy, but I'm not quite sure how to use that if I'm supposed to.

                  感謝您的幫助.

                  推薦答案

                  我猜你在問如何用鍵盤控制槳.我假設(shè)您的計(jì)算機(jī)上運(yùn)行了最終的乒乓球代碼(如果沒有,您可以在 本節(jié)).

                  I guess you are asking how to control the paddles with the keyboard. I assume you have the final ping pong codes running on your computer (If not, you can find them at the end of this section).

                  1 - 在 main.py 中導(dǎo)入 Window 類:

                  1 - In the main.py import the Window class:

                  from kivy.core.window import Window
                  

                  2 - 重新定義 PongGame 類的開頭,使其如下所示:

                  2 - Redefine the beginning of the PongGame class so it looks like the following:

                  class PongGame(Widget):
                      ball = ObjectProperty(None)
                      player1 = ObjectProperty(None)
                      player2 = ObjectProperty(None)
                  
                      def __init__(self, **kwargs):
                          super(PongGame, self).__init__(**kwargs)
                          self._keyboard = Window.request_keyboard(self._keyboard_closed, self)
                          self._keyboard.bind(on_key_down=self._on_keyboard_down)
                  
                      def _keyboard_closed(self):
                          self._keyboard.unbind(on_key_down=self._on_keyboard_down)
                          self._keyboard = None
                  
                      def _on_keyboard_down(self, keyboard, keycode, text, modifiers):
                          if keycode[1] == 'w':
                              self.player1.center_y += 10
                          elif keycode[1] == 's':
                              self.player1.center_y -= 10
                          elif keycode[1] == 'up':
                              self.player2.center_y += 10
                          elif keycode[1] == 'down':
                              self.player2.center_y -= 10
                          return True
                  

                  瞧!按 ws 為左槳,按 updown 為右槳.

                  Voilà! Press w and s for the left paddle and up and down for the right paddle.

                  這篇關(guān)于您如何使用 kivy 檢查鍵盤事件?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個(gè)在 Python 中提供角色的不和諧機(jī)器人?)
                  Discord bot isn#39;t responding to commands(Discord 機(jī)器人沒有響應(yīng)命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機(jī)器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機(jī)器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動(dòng)更改角色顏色)
                    <i id='zREnn'><tr id='zREnn'><dt id='zREnn'><q id='zREnn'><span id='zREnn'><b id='zREnn'><form id='zREnn'><ins id='zREnn'></ins><ul id='zREnn'></ul><sub id='zREnn'></sub></form><legend id='zREnn'></legend><bdo id='zREnn'><pre id='zREnn'><center id='zREnn'></center></pre></bdo></b><th id='zREnn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zREnn'><tfoot id='zREnn'></tfoot><dl id='zREnn'><fieldset id='zREnn'></fieldset></dl></div>
                  • <small id='zREnn'></small><noframes id='zREnn'>

                          <bdo id='zREnn'></bdo><ul id='zREnn'></ul>
                          <tfoot id='zREnn'></tfoot>

                            <tbody id='zREnn'></tbody>
                          <legend id='zREnn'><style id='zREnn'><dir id='zREnn'><q id='zREnn'></q></dir></style></legend>

                            主站蜘蛛池模板: 欧美一区在线视频 | 日韩欧美成人一区二区三区 | 九九热精品视频 | 欧美日韩成人一区二区 | 精品在线一区 | 亚洲精品一区二区网址 | 一级黄色片毛片 | 久久久久久久久久久久久久久久久久久久 | 久久国产精品72免费观看 | 欧美亚洲国语精品一区二区 | 在线视频一区二区三区 | 精品美女 | 国产精品免费大片 | 99精品欧美一区二区三区 | 97精品国产一区二区三区 | 国产精品毛片无码 | 黄视频欧美 | 91在线观| 亚洲综合热 | 日本小电影在线 | 国产日韩欧美一区 | 久久精品中文 | 午夜免费 | 少妇淫片aaaaa毛片叫床爽 | 精品中文字幕久久 | 国产日韩免费视频 | 国产一级在线 | 91精品国产一区二区在线观看 | 国产精品一区二 | 精品久久香蕉国产线看观看亚洲 | 久久精品无码一区二区三区 | 国产精品一区二区免费 | 欧美激情黄色 | 97色在线视频| 欧美日韩在线观看一区 | 亚洲欧美在线视频 | 精品一区二区观看 | 欧美在线播放一区 | 久久久成人免费一区二区 | 中文字幕一区二区三 | 中文字幕 国产 |