CanvasGadget() / Left- and Right-Click (was: Strange)

Just starting out? Need help? Post your questions and find answers here.
User avatar
Erlend
Enthusiast
Enthusiast
Posts: 114
Joined: Mon Apr 19, 2004 8:22 pm
Location: NORWAY

CanvasGadget() / Left- and Right-Click (was: Strange)

Post by Erlend »

The below code on my Debian system is switched left is right and right is left, can someone confirm??

Code: Select all

OpenWindow(0,0,0,500,500,"")

CanvasGadget(0,0,0,495,495,#PB_Canvas_Border|#PB_Canvas_Keyboard)

Procedure Callback()
  ;Debug "event" 
  evgadget=EventGadget()
  *mem=GetGadgetData(evgadget)
  Select EventType()
    Case #PB_Canvas_RightButton
      Debug "Right"
    Case #PB_Canvas_LeftButton
      Debug "Left"  
  EndSelect     
EndProcedure

 BindEvent(#PB_Event_Gadget,@Callback(),0,0)  

Repeat
  event=WaitWindowEvent()
Until event=#PB_Event_CloseWindow
BR
Erlend

// Moved from "Bugs - Linux" to "Coding Questions" (Kiffi)
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: CanvasGadget() / Left- and Right-Click (was: Strange)

Post by infratec »

And from which PB version you are talking?
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 188
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: CanvasGadget() / Left- and Right-Click (was: Strange)

Post by moulder61 »

On my Void Linux install using PB 6.11 LTS Beta 2, I can confirm that right click says left and double left click says right.

Moulder.
"If it ain't broke, fix it until it is!

This message is brought to you thanks to SenselessComments.com

My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
User avatar
mk-soft
Always Here
Always Here
Posts: 6202
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: CanvasGadget() / Left- and Right-Click (was: Strange)

Post by mk-soft »

No Bug

You check with wrong constant ...

Code: Select all

OpenWindow(0,0,0,500,500,"")

CanvasGadget(0,0,0,495,495,#PB_Canvas_Border|#PB_Canvas_Keyboard)

Procedure Callback()
  ;Debug "event" 
  evgadget=EventGadget()
  *mem=GetGadgetData(evgadget)
  Select EventType()
    Case #PB_EventType_RightClick
      Debug "RightClick"
    Case #PB_EventType_LeftClick
      Debug "LeftClick"  
  EndSelect
  
  button = GetGadgetAttribute(evgadget, #PB_Canvas_Buttons)
  If button & #PB_Canvas_LeftButton
    Debug "Canvas LeftButton"
  EndIf
  If button & #PB_Canvas_RightButton
    Debug "Canvas RightButton"
  EndIf
  
EndProcedure

BindEvent(#PB_Event_Gadget,@Callback(),0,0)  

Repeat
  event=WaitWindowEvent()
Until event=#PB_Event_CloseWindow
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply