4 * Copyright (C) 2004-2011 Simon Wunderlich <dotslash@packetmixer.de>
6 * This file is part of s3d, a 3d network display server.
7 * See http://s3d.berlios.de/ for more updates.
9 * s3d is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * s3d is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with s3d; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 /* this file reads user input */
56 void user_key(uint16_t key
, uint16_t unicode
, uint16_t mod
, int state
)
58 event_key_pressed(key
, unicode
, mod
, state
);
61 void user_mouse(int button
, int state
, int x
, int y
)
64 case 0: /* mouse_down ... */
67 graphics_pick_obj(x
, y
);
70 if ((ox
!= 0xFFFFFF) && (oy
!= 0xFFFFFF))
71 navi_pos(ox
- x
, oy
- y
);
74 if ((ox
!= 0xFFFFFF) && (oy
!= 0xFFFFFF))
75 navi_rot(ox
- x
, oy
- y
);
84 s3dprintf(VLOW
, "button is ... %d", button
);
88 event_mbutton_clicked(button
, state
);
90 case 1: /* mouse up */
92 event_mbutton_clicked(button
, state
);
93 /* s3dprintf(LOW,"state is: %d,button is %d",state,button); */
95 case 2: /* mouse still down */
98 if ((ox
!= 0xFFFFFF) && (oy
!= 0xFFFFFF))
99 navi_pos(ox
- x
, oy
- y
);
102 if ((ox
!= 0xFFFFFF) && (oy
!= 0xFFFFFF))
103 navi_rot(ox
- x
, oy
- y
);
112 s3dprintf(VLOW
, "button is ... %d", button
);