Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mouse Button Hold Event
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
icebreeze
n00b
n00b


Joined: 30 Aug 2005
Posts: 36

PostPosted: Thu Jul 06, 2006 5:57 am    Post subject: Mouse Button Hold Event Reply with quote

Is there any way to get your mouse click to act similar to a keypress? For example in a game if you hold the crouch button on the keyboard the button stays crouched and once you let go you are uncrouched. However as it stays now if you use the mouse to crouch the event is sent only once even if you keep the button held down. Is there any way to make it stay crouched and then release once you let go of the button?
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Thu Jul 06, 2006 6:02 am    Post subject: Reply with quote

What game?
In UT2004 I use a mouse button for continuous crouching.
Back to top
View user's profile Send private message
icebreeze
n00b
n00b


Joined: 30 Aug 2005
Posts: 36

PostPosted: Thu Jul 06, 2006 6:04 am    Post subject: Reply with quote

jedi academy. It worked fine in windows however it isn't in wine. Its based off the Q3 engine.
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Thu Jul 06, 2006 6:05 am    Post subject: Reply with quote

icebreeze wrote:
jedi academy. It worked fine in windows however it isn't in wine. Its based off the Q3 engine.

It might be more an issue with wine then. I would check the Wine forums also for some possible leds.
Back to top
View user's profile Send private message
icebreeze
n00b
n00b


Joined: 30 Aug 2005
Posts: 36

PostPosted: Thu Jul 06, 2006 6:29 am    Post subject: Reply with quote

actually i don't think its a wine issue. I found that the crouching works fine with mouse 1 and 2 (left and right click) but if i try to use my thumb buttons it does not hold. Maybe it is some xmodmap thing?
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Thu Jul 06, 2006 6:33 am    Post subject: Reply with quote

icebreeze wrote:
actually i don't think its a wine issue. I found that the crouching works fine with mouse 1 and 2 (left and right click) but if i try to use my thumb buttons it does not hold. Maybe it is some xmodmap thing?

Can you use the program xev and see what events are happening when you press the thumb buttons.

It sounds like you might have cruise control on which causes two mouse events. (Appears like a scrollwheel also)

What kind of mouse is it?
Back to top
View user's profile Send private message
icebreeze
n00b
n00b


Joined: 30 Aug 2005
Posts: 36

PostPosted: Thu Jul 06, 2006 6:51 am    Post subject: Reply with quote

mx1000

for a button that stays crouched

Code:
ButtonPress event, serial 31, synthetic NO, window 0x1c00001,
    root 0x137, subw 0x0, time 1117385655, (129,27), root:(134,830),
    state 0x0, button 1, same_screen YES

ButtonRelease event, serial 31, synthetic NO, window 0x1c00001,
    root 0x137, subw 0x0, time 1117385783, (129,27), root:(134,830),
    state 0x100, button 1, same_screen YES


a button that doesn't stay crouched.

Code:
ButtonPress event, serial 31, synthetic NO, window 0x1c00001,
    root 0x137, subw 0x0, time 1117424913, (172,11), root:(177,814),
    state 0x0, button 7, same_screen YES

ButtonRelease event, serial 31, synthetic NO, window 0x1c00001,
    root 0x137, subw 0x0, time 1117426920, (172,11), root:(177,814),
    state 0x0, button 7, same_screen YES
Back to top
View user's profile Send private message
icebreeze
n00b
n00b


Joined: 30 Aug 2005
Posts: 36

PostPosted: Thu Jul 06, 2006 6:29 pm    Post subject: Reply with quote

If one of the thumb buttons are bound in the 3 mouse binds in xmodmap it works. It becomes known as mouse button 1 - 3. Now if i go past that number it begins to do that non holding action.

For example:

This is the original xmodmap that makes all the keys work in xorg. Back and foward and scrolling all work fine.

Code:
pointer = 1 3 2 4 5 8 9 6 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32


The button 1 3 and 2 are the only ones that are allowed to correctly crouch.

Say I swap button number 3 with number 6

Code:
pointer = 1 6 2 4 5 8 9 3 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32


Now in wine the bottom thumb button becomes known as button 2 and the right mouse button becomes button 4. So the crouching works correctly with the thumb then but not the right mouse button.

There has to be some sort of limitation that is going on.


So does anyone have an idea on what my next step should be?
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Thu Jul 06, 2006 6:44 pm    Post subject: Reply with quote

Are you using the evdev driver for the mouse in xorg.conf?

I still think that somehow that wine is only recognizing the minimal number of buttons correctly. I don't know enough about wine or have a wine emulated game that uses multiple buttons to test.
Back to top
View user's profile Send private message
icebreeze
n00b
n00b


Joined: 30 Aug 2005
Posts: 36

PostPosted: Thu Jul 06, 2006 7:49 pm    Post subject: Reply with quote

yes i've using evdev. but if wine wasn't recognising the buttons it wouldn't show up as a mouse click. the buttons come up as mouse1-5 in the game so the event is going through. However i belive it must be some xorg or xmodmap thing since like i said if i change the bind order the keys work fine.
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Thu Jul 06, 2006 11:50 pm    Post subject: Reply with quote

icebreeze wrote:
yes i've using evdev. but if wine wasn't recognising the buttons it wouldn't show up as a mouse click. the buttons come up as mouse1-5 in the game so the event is going through. However i belive it must be some xorg or xmodmap thing since like i said if i change the bind order the keys work fine.

What I'm trying to state is that often buttons 4 and 5 on many mouse drivers are mapped to the scroll wheel. So in wine if it is expecting the same, the clicks still get registered, but not the way you want.

All xmodmap does is change the button order, so that if you remapped the higher buttons to the first three mouse buttons, this would fit my idea of why it works the way it does.

Do you have a linux native game you can test the extra buttons in? If not, maybe install ut2004-demo or something so you can test and see whether it is X, or X with wine.
Back to top
View user's profile Send private message
icebreeze
n00b
n00b


Joined: 30 Aug 2005
Posts: 36

PostPosted: Fri Jul 07, 2006 2:43 am    Post subject: Reply with quote

ok i'll try that when i can
Back to top
View user's profile Send private message
icebreeze
n00b
n00b


Joined: 30 Aug 2005
Posts: 36

PostPosted: Fri Jul 07, 2006 4:21 pm    Post subject: Reply with quote

I just tried tremulous and mouse button 4 holds. So I guess it is a wine problem. Now how to solve it I don't know.... I guess i could make a script to have it swap keys when the program launches and then swap back when its done... However I'd like a more non 'dirty hack' solution. Any ideas?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum