Date:2011-06-16 12:46:43 (12 years 9 months ago)
Author:David Kühling
Commit:33f9a733fe09f5237dadd9be22047252799b3c00
Message:ase: improved keyboard-mouse support: filter out arrow keys unless shift pressed

Files: ase/patches/090-keyboard-mouse.patch (5 diffs)

Change Details

ase/patches/090-keyboard-mouse.patch
11Index: ase-0.8.2/src/jinete/jsystem.cpp
22===================================================================
33--- ase-0.8.2.orig/src/jinete/jsystem.cpp 2011-06-14 22:25:51.681509956 +0200
4+++ ase-0.8.2/src/jinete/jsystem.cpp 2011-06-14 23:24:30.101508957 +0200
54@@ -29,6 +29,8 @@
65  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
76  */
...... 
3030   m_z[0] = mouse_z;
3131
3232   update_mouse_position();
33@@ -438,8 +443,130 @@
33@@ -438,8 +443,135 @@
3434     return false;
3535 }
3636
...... 
5757+ return;
5858+ }
5959+
60+ if (key[KEY_LEFT]) {
60+ /* The patched jmessage.cpp filters out all arrow key messages, unless the
61+ shift key is held, so it's better to disable the keyboard mouse on shift
62+ key */
63+ int shift = key_shifts&KB_SHIFT_FLAG;
64+
65+ if (!shift && key[KEY_LEFT]) {
6166+ speed_x -= ak*delta_t;
6267+ }
63+ else if (key[KEY_RIGHT]) {
68+ else if (!shift && key[KEY_RIGHT]) {
6469+ speed_x += ak*delta_t;
6570+ }
6671+ else {
...... 
7681+ }
7782+ }
7883+
79+ if (key[KEY_UP]) {
84+ if (!shift && key[KEY_UP]) {
8085+ speed_y -= ak*delta_t;
8186+ }
82+ else if (key[KEY_DOWN]) {
87+ else if (!shift && key[KEY_DOWN]) {
8388+ speed_y += ak*delta_t;
8489+ }
8590+ else {
...... 
184189       <key command="goto_last_frame" shortcut="End" />
185190       <key command="play_animation" shortcut="Enter" />
186191       <!-- Select -->
192Index: ase-0.8.2/src/jinete/jmessage.cpp
193===================================================================
194--- ase-0.8.2.orig/src/jinete/jmessage.cpp 2011-06-16 12:43:59.718215107 +0200
195@@ -81,6 +81,18 @@
196   msg->key.propagate_to_children = false;
197   msg->key.propagate_to_parent = true;
198
199+ /* ignore arrow keys without shift, to not interfere with the
200+ * keyboard-mouse */
201+ switch (msg->key.scancode)
202+ {
203+ case KEY_UP:
204+ case KEY_DOWN:
205+ case KEY_LEFT:
206+ case KEY_RIGHT:
207+ if (!(msg->any.shifts&KB_SHIFT_FLAG))
208+ msg->any.used = true;
209+ }
210+
211 #if 0
212   printf("%i: %i %i [%c]\n", type, msg->key.scancode,
213      msg->key.ascii, msg->key.ascii);

Archive Download the corresponding diff file



interactive