Author Topic: Mouse clicking  (Read 3148 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris Cromer

Mouse clicking
« on: April 11, 2002, 03:45:37 AM »
How can I tell the difference between a right click and a left click?... I tried using the hex thing to print it out but I always get a null. I need to figure this out so I can add proper mouse support to my template instead of the right click doing the same thing as the left click.


Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Brian Provinciano

Re:Mouse clicking
« Reply #1 on: April 16, 2002, 12:54:59 AM »
II added...

Format(str "Mouse X:%d Y:%d  :%d :%d: %d  " x y type message modifiers)

to the event code to see what happens when I click and have discovered that only the left button even causes an event. The right button is completely ignored. I remember you mentioning QFG using it or something. Are you sure it was an SCI0 game?

Offline Chris Cromer

Re:Mouse clicking
« Reply #2 on: April 16, 2002, 06:04:11 AM »
Well the interpreter is 0.000.629 and I am pretty positive it is SCI0 since I can edit it in SCI Studio an SCI Graphic Studio. It is the original Quest for Glory and not the remake. In the game if you click with the left mouse button it moves the ego, and if you click with the right mouse button it gives a description of the thing you are clicking on. So there has to be a way to detect the right button... I just don't know how though.
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Brian Provinciano

Re:Mouse clicking
« Reply #3 on: April 16, 2002, 09:34:39 AM »
Try using that interpreter with the event example and see if the right button changes any of the event properties.

Offline Chris Cromer

Re:Mouse clicking
« Reply #4 on: April 16, 2002, 12:55:29 PM »
Sure I will try that.
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Chris Cromer

Re:Mouse clicking
« Reply #5 on: April 16, 2002, 03:13:40 PM »
Well the only thing that ever seems to change between the different clicks is the modifier. I think I might try using the modifier to detect which button... 32 = left click 35 = right click and 36 = middle click. Shoudl I use the modifier though? And what exactly is the modifier?
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Brian Provinciano

Re:Mouse clicking
« Reply #6 on: April 16, 2002, 05:24:49 PM »
It's very good you noticed that the intepreter with SCI Studio doesn't support that. I've packaged the newer SCI0 intepreter with the SCI Studio package which will be released tomorrow.

I found out that bits 0-1 of "modifiers" is used for the right button. $0 for left and $3 for right. I don't have a three button mouse installed on here, but from what you say, it seems that bit 2 would mean the middle is pressed.

               (if (== (& modifiers 3) 3 )
                   Display("Right  " dsCOORD 130 20 dsCOLOR clFUCHSIA dsBACKGROUND clBLACK)
               )(else
                   Display("Left   " dsCOORD 130 20 dsCOLOR clFUCHSIA dsBACKGROUND clBLACK)
               )

works perfectly with the newer interpreter. Try it out!

Keep your eyes peeled for the next release of SS.

Offline Chris Cromer

Re:Mouse clicking
« Reply #7 on: April 16, 2002, 08:13:10 PM »
Well glad to see that I can tell the difference between the left and right click and maybe middle I will just have to make sure it works... I think I will add these to the scc.sch to make them easier to use. Well now that I figured this out I can finish making the ego walk to the position where the mouse clicks, and make a description for the right click as an example on what it can do.
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline lskovlun

Re:Mouse clicking
« Reply #8 on: May 29, 2002, 11:01:59 AM »
The interpreters don't actually support the middle and right
buttons, but instead alias them with Shift- and Ctrl-clicking.

So, as someone suggested, test the modifiers if you really
need to. The full story about events is here:

http://freesci.linuxgames.com/scihtml/c5100.html

Offline robingravel

Re:Mouse clicking
« Reply #9 on: May 13, 2003, 01:52:43 PM »
I'll try it out.


Robin Gravel

Offline Zero

Re:Mouse clicking
« Reply #10 on: May 13, 2003, 04:42:07 PM »
Cool so will i once i get back in to SCI.
Zero has just programmed a post please read.

Offline robingravel

Re:Mouse clicking
« Reply #11 on: May 13, 2003, 06:07:57 PM »
Hi Zero

I'll make template using right click after I released Naturette 3.


Robin Gravel

Offline Zero

Re:Mouse clicking
« Reply #12 on: May 13, 2003, 06:24:23 PM »
Hey Robin
 How are you?

im sure the template will be great!! :)
lost of people would love to download something like that!!!!


You are the best!!!
Zero has just programmed a post please read.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.03 seconds with 16 queries.