Liberty BASIC Community Forum
« Middle Button »

Welcome Guest. Please Login or Register.
Sep 21st, 2017, 12:17am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Middle Button  (Read 299 times)
UAC48
New Member
Image


member is offline

Avatar




PM


Posts: 13
xx Middle Button
« Thread started on: Jun 25th, 2017, 01:02am »

Hello Dear !

It seems mouse middle button works fine when running under LB editor, but are not suitable when transformed in EXE/TKN.

i.e : when middleButtonDown [subname]

Any ideas ?...

Many Thanks.

Louis.
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5526
xx Re: Middle Button
« Reply #1 on: Jun 25th, 2017, 01:54am »

Is this the problem you see?

http://libertybasicbugs.wikispaces.com/middleButtonMove+event
User IP Logged

UAC48
New Member
Image


member is offline

Avatar




PM


Posts: 13
xx Re: Middle Button
« Reply #2 on: Jun 25th, 2017, 02:20am »

Dear Rod,

Thanks for your fast reply !

This code works fine if runned through LB editor ("Run" ou "Run TKN") but not outside LB editor (run via "Run451" renamed)

Regards,

Louis.
User IP Logged

UAC48
New Member
Image


member is offline

Avatar




PM


Posts: 13
xx Re: Middle Button
« Reply #3 on: Jun 25th, 2017, 03:50am »

The problem occures under Windows7 & XP.
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5526
xx Re: Middle Button
« Reply #4 on: Jun 25th, 2017, 04:05am »

The bug in the linked code is in fact program flow and poorly managed events. This code fixes it by managing the events. It remains the fact that the middle mouse button is ignored once compiled to an .exe. Perhaps it is a limitation of smalltalk. One for Carl really.

Code:
nomainwin
  open "middleButtonMove" for graphics as #w
  #w "trapclose [quit]"

  #w "when middleButtonDown [MBdown]"
  #w "when leftButtonDown [LBdown]"
  #w "when rightButtonDown [RBdown]"
  #w "down"
  #w "\"
  #w "\Move mouse over window. - "
  #w "\Press and hold Middle Mouse Button, "
  #w "\  move mouse over window. - "
  wait



[MBpaint]
    #w "size 3"
    #w "color blue; set "; MouseX; " "; MouseY
  wait
[LBdown]
    #w "\Left Button"
    wait

[MBdown]
    'the user pressed middle button close that event and start new ones
    #w "\Middle Button"
    #w "when middleButtonDown"
    #w "when mouseMove [MBpaint]"
    #w "when middleButtonUp [MBup]"
    wait

[RBdown]
    #w "\Right Button"
    wait


[MBup]
    'the user released the middle button
    'close tracking and start looking for down
    #w "when mouseMove"
    #w "when middleButtonUp"
    #w "when middleButtonDown [MBdown]"
    wait

[quit]
    close #w
    end

 
User IP Logged

UAC48
New Member
Image


member is offline

Avatar




PM


Posts: 13
xx Re: Middle Button
« Reply #5 on: Jun 25th, 2017, 04:16am »

Hi Rod,

Exactly the same phenomenon with this code... of course...

Take care.

Louis.
User IP Logged

UAC48
New Member
Image


member is offline

Avatar




PM


Posts: 13
xx Re: Middle Button
« Reply #6 on: Jun 25th, 2017, 05:31am »

Hi All !

End of alert for my part...

I'm using :

Calldll #user32, "GetKeyState", _VK_MBUTTON As uLong, reskey As uShort

and check for reskey variations in ordre to detect middle button down and up...

All is right, now ! Happy end !

Greats,

Louis.
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5526
xx Re: Middle Button
« Reply #7 on: Jun 25th, 2017, 2:30pm »

Easy workaround, well done, but it remains a bug in Liberty.
User IP Logged

UAC48
New Member
Image


member is offline

Avatar




PM


Posts: 13
xx Re: Middle Button
« Reply #8 on: Jun 25th, 2017, 4:30pm »

on Jun 25th, 2017, 2:30pm, Rod wrote:
Easy workaround, well done, but it remains a bug in Liberty.


It remains ! ! !... rolleyes
User IP Logged

tsh73
Board Moderator

member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1681
xx Re: Middle Button
« Reply #9 on: Jun 27th, 2017, 02:05am »

**confused**
program from #reply4 works for me from LB4.04 IDE/TKN
(and even in JB too)
Tht is, then middle button pressed, it says "Middle button"
and if I hold it, it draws points.

What exactly the problem?
User IP Logged

damned Dog in the Manger
Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5526
xx Re: Middle Button
« Reply #10 on: Jun 27th, 2017, 02:58am »

Yes, it works as a .bas and a .tkn and in the debugger but it does not work when compiled to an .exe. The middle mouse event is ignored or does not fire.
User IP Logged

tsh73
Board Moderator

member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1681
xx Re: Middle Button
« Reply #11 on: Jun 27th, 2017, 03:48am »

I thought "compiled to EXE" is exactly the same as running TKN with run404.exe, so dragging TKN on run404.exe shoul work exactly like that?
And then I drag it middle button works.

EDIT just went and created EXE from 4.04 (Run \ Create application).
Middle button works.

(tested under Win XP SP3)
User IP Logged

damned Dog in the Manger
Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5526
xx Re: Middle Button
« Reply #12 on: Jun 27th, 2017, 04:03am »

OK did some more testing, Win 10 using v4.5.1 the middle mouse button is ignored. On v4.04 the middle mouse button works.

So something has changed since v4.04
User IP Logged

CarlGundel
Administrator
ImageImageImageImageImage


member is offline

Avatar

author of Liberty BASIC


Homepage PM


Posts: 2833
xx Re: Middle Button
« Reply #13 on: Jun 27th, 2017, 08:01am »

Well, I will have to investigate.

-Carl
User IP Logged

author of Liberty BASIC
http://www.libertybasic.com
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls