I want to create a little game in java and swt. For this reason, I have to respond to KeyEvents. How can I check, for example, the up and q keys are compressed together?
Thanks in advance Phineas
Actually, you can implement this. Each key down and the key has its own event, so you know exactly which keys are pressed, when and which keys are reset at any time.
: , . X, . Key key key, , , . = > .
- , .
SWT ( , shift, alt ..). , , - "q" . , ( KeyEvent) , (50 ? ).
q , , , q , , , q. , . , q .
rancidfishbreath . . http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet25.java
Thank you for your responses! I just thought that I could develop the game with a little pon rather quickly, but I did not know that key bindings are so difficult to handle! The main obstacle is that the two oars must be moved independently (currently pressing keys interferes with the movement of opponents and vice versa).
Source: https://habr.com/ru/post/1763848/More articles:Using static finals in Android activity - androidpassing callback as upload_to to FileField - directoryДиалоговое окно подтверждения в ActionLink с использованием ASP.NET MVC 2 - asp.net-mvccheck if string contains ip address - c #Resources: users: as => 'equivalent members in Rails 3 - ruby-on-railsIs there a way to specify "initial" values in css abbreviations, for example, padding? - csscustom error response in WCF data services - wcf-data-servicesThe website ignores System.Web.HttpForbiddenHandler and allows the loading of web.config - web-configWhat is the best GUI designer to use with Eclipse? - javaHow can I use the `tests` parameter after the declaration in Perl Test :: More? - perlAll Articles