{"action":"created","issue":{"url":"https://api.github.com/repos/UPBGE/blender/issues/231","repository_url":"https://api.github.com/repos/UPBGE/blender","labels_url":"https://api.github.com/repos/UPBGE/blender/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/UPBGE/blender/issues/231/comments","events_url":"https://api.github.com/repos/UPBGE/blender/issues/231/events","html_url":"https://github.com/UPBGE/blender/issues/231","id":179614501,"number":231,"title":"Keyboard sensor cannot work only for pressing","user":{"login":"vlad1777d","id":12682937,"avatar_url":"https://avatars.githubusercontent.com/u/12682937?v=3","gravatar_id":"","url":"https://api.github.com/users/vlad1777d","html_url":"https://github.com/vlad1777d","followers_url":"https://api.github.com/users/vlad1777d/followers","following_url":"https://api.github.com/users/vlad1777d/following{/other_user}","gists_url":"https://api.github.com/users/vlad1777d/gists{/gist_id}","starred_url":"https://api.github.com/users/vlad1777d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlad1777d/subscriptions","organizations_url":"https://api.github.com/users/vlad1777d/orgs","repos_url":"https://api.github.com/users/vlad1777d/repos","events_url":"https://api.github.com/users/vlad1777d/events{/privacy}","received_events_url":"https://api.github.com/users/vlad1777d/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-27T21:08:47Z","updated_at":"2016-09-28T17:12:07Z","closed_at":"2016-09-28T12:57:45Z","body":"Hello friends.\r\n\r\nIn this issue: https://github.com/UPBGE/blender/issues/196 I suggested to add the **button** to keyboard sensor, which will answer to **activating mode**: \r\n-pressed: keyboard sensor activates on releasing and pressing key;\r\n-unpressed: keyboard sensor activates only on pressing the key;\r\nBecause people, who did not use Python, only a logic bricks, very often want sensor be activated only if key was pressed, not twice: when pressed and when released.\r\n\r\nIn IRC @panzergame told me that such behavior I can achieve with \"Tap\" button, and those issue was successfully closed.\r\nThis is not so, in this expample: [keyboard_issue.blend.zip](https://github.com/UPBGE/blender/files/496591/keyboard_issue.blend.zip) you can see, that after pressing \"space\" (with activated \"Tap\" button), Python controller **activates twice**:\r\n![2016-09-27 23-42-48](https://cloud.githubusercontent.com/assets/12682937/18891138/9e967e50-850c-11e6-9a6d-fce0aa4dd9f0.png)\r\n\r\nMaybe it's a **bug** with tap button, than it needs to be corrected. \r\nIf it's **normal behavior**, than, I think, there is need to add \"**activate mode**\" button.\r\n\r\nBecause people, who don't know Python could not simply achieve such behavior: one pressing - one operation.\r\nWith other combinations of current buttons we could not reach needed behavior.\r\n\r\n**Such behavior is needed when**:\r\n\\> We need to increase amount of something;\r\n\\> add some object to scene (otherwise, with a tab button 2 objects will be added to one place);\r\n\\> make purchase (increase one property, decrease second) (of course, we could divide amounts into two and get same result, but it's not good way);\r\n\\> one pressing of one key activates animation, second pressing of this key stops it;\r\n\\> move object to certain distance and etc.\r\n\r\nWith using Python this problem is solved easily, without it - sometimes very difficultly or impossible. \r\nI know, that without Python it's almost impossible to build a complex game, but I think, that we must take into account and those people, who make not difficult scenes \"for themselves\" and don't know Python.\r\n\r\nBest regards,\r\nVladislav."},"comment":{"url":"https://api.github.com/repos/UPBGE/blender/issues/comments/250232936","html_url":"https://github.com/UPBGE/blender/issues/231#issuecomment-250232936","issue_url":"https://api.github.com/repos/UPBGE/blender/issues/231","id":250232936,"user":{"login":"vlad1777d","id":12682937,"avatar_url":"https://avatars.githubusercontent.com/u/12682937?v=3","gravatar_id":"","url":"https://api.github.com/users/vlad1777d","html_url":"https://github.com/vlad1777d","followers_url":"https://api.github.com/users/vlad1777d/followers","following_url":"https://api.github.com/users/vlad1777d/following{/other_user}","gists_url":"https://api.github.com/users/vlad1777d/gists{/gist_id}","starred_url":"https://api.github.com/users/vlad1777d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlad1777d/subscriptions","organizations_url":"https://api.github.com/users/vlad1777d/orgs","repos_url":"https://api.github.com/users/vlad1777d/repos","events_url":"https://api.github.com/users/vlad1777d/events{/privacy}","received_events_url":"https://api.github.com/users/vlad1777d/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T17:12:07Z","updated_at":"2016-09-28T17:12:07Z","body":"@panzergame , no, I mean next:\r\nmany times (I described in first message) there is need to activate actuator only one time - on pressing (or releasing) key.\r\n>Key \"space\" was pressed - actuator \"a\" launched one time.\r\n\r\n**UPBGE had such behavior** before you closed https://github.com/UPBGE/blender/issues/196 , and I'm sure, **such behavior**, as was present before closing bug, **is needed** (and I wrote it in that bugreport). \r\nIt's needed for people , who doesn't know Python and\\or makes simple scenes (other people could make checks of sensor's state in Python) (for reasons, that I described here in first message and I'm duplicating them below).\r\n\r\n**Such behavior is needed when**:\r\n\\> We need to increase amount of something;\r\n\\> add some object to scene (otherwise, with a tab button 2 objects will be added to one place);\r\n\\> make purchase (increase one property, decrease second) (of course, we could divide amounts into two and get same result, but it's not good way);\r\n\\> one pressing of one key activates animation, second pressing of this key stops it;\r\n\\> move object to certain distance and etc.\r\n\r\n**I wrote that bugreport because that behavior did not allowed activating scripts on key releasing** using keyboard sensor (allowed only using always sensor with checks through Python every frame).\r\nBut I also noticed, that that behavior is very useful (and, we can say, necessary) and there is need to save it. For example, by **adding \"activating mode\" button**."}}
{"actor":{"display_login":"vlad1777d"}}