Keyboard shortcuts for mouse wheel
- marcoagpinto
- Addict
- Posts: 939
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Keyboard shortcuts for mouse wheel
Hello Fred,
Could you add two new types of keyboard shortcuts regarding if one scrolls the mouse wheel up or down?
#PB_Shortcut_MouseWheel_Up
#PB_Shortcut_MouseWheel_Down
?
Or something like that?
It would be very useful if one uses virtual ListIconGadgets, since I have been asking for help regarding them and no one seems to give a solution to the problem.
Thanks!
Could you add two new types of keyboard shortcuts regarding if one scrolls the mouse wheel up or down?
#PB_Shortcut_MouseWheel_Up
#PB_Shortcut_MouseWheel_Down
?
Or something like that?
It would be very useful if one uses virtual ListIconGadgets, since I have been asking for help regarding them and no one seems to give a solution to the problem.
Thanks!
Re: Keyboard shortcuts for mouse wheel
Keyboard Shortcuts ?
I think you mean EventTypes....
But normally, you can scroll in a Listview with the Cursor up&down keys....
or if you made a Listview by yourself.. you have to create such functionality
I think you mean EventTypes....
But normally, you can scroll in a Listview with the Cursor up&down keys....
or if you made a Listview by yourself.. you have to create such functionality
- marcoagpinto
- Addict
- Posts: 939
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Keyboard shortcuts for mouse wheel
How?Bisonte wrote:Keyboard Shortcuts ?
or if you made a Listview by yourself.. you have to create such functionality
Re: Keyboard shortcuts for mouse wheel
This depends on how you created the ListView.
If you show the complete code of your ListView, there is probably
someone who can implement this function. Maybe even me
If you show the complete code of your ListView, there is probably
someone who can implement this function. Maybe even me
- marcoagpinto
- Addict
- Posts: 939
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Keyboard shortcuts for mouse wheel
It is a ListIconGadget, not a ListView.Bisonte wrote:This depends on how you created the ListView.
If you show the complete code of your ListView, there is probably
someone who can implement this function. Maybe even me
- marcoagpinto
- Addict
- Posts: 939
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Keyboard shortcuts for mouse wheel
Anyway, the project is open-source.
You can download the source from its official page:
http://proofingtoolgui.org
However, I am currently working on build 120 which will be release after Fred updates PB 5.61 since there are issues with Ubuntu 17.10.
On build 120 I have been cleaning the code to make everything look better.
You can download the source from its official page:
http://proofingtoolgui.org
However, I am currently working on build 120 which will be release after Fred updates PB 5.61 since there are issues with Ubuntu 17.10.
On build 120 I have been cleaning the code to make everything look better.
Re: Keyboard shortcuts for mouse wheel
If it is a normal ListIconGadget, you can scroll the list with the cursor keys (on windows) if it has the focus....
- marcoagpinto
- Addict
- Posts: 939
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Keyboard shortcuts for mouse wheel
It is not a normal ListIconGadget as I download the lines into an array, and only show 13 at a time (customisable).Bisonte wrote:If it is a normal ListIconGadget, you can scroll the list with the cursor keys (on windows) if it has the focus....
I had to code by hand the curs up/down.
Re: Keyboard shortcuts for mouse wheel
Marco, is this what you want? (Windows only).marcoagpinto wrote:Could you add two new types of keyboard shortcuts regarding if one scrolls the mouse wheel up or down?
Code: Select all
If OpenWindow(0,300,300,400,200,"MouseWheel",#PB_Window_SystemMenu)
TextGadget(0,20,20,200,20,"Scroll the mouse wheel...")
Repeat
ev=WaitWindowEvent()
If ev=#WM_MOUSEWHEEL
If EventwParam()>0
SetGadgetText(0,"UP")
ElseIf EventwParam()<0
SetGadgetText(0,"DOWN")
EndIf
EndIf
Until ev=#PB_Event_CloseWindow
EndIf
- marcoagpinto
- Addict
- Posts: 939
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Keyboard shortcuts for mouse wheel
Dude wrote:Marco, is this what you want? (Windows only).marcoagpinto wrote:Could you add two new types of keyboard shortcuts regarding if one scrolls the mouse wheel up or down?
Code: Select all
If OpenWindow(0,300,300,400,200,"MouseWheel",#PB_Window_SystemMenu) TextGadget(0,20,20,200,20,"Scroll the mouse wheel...") Repeat ev=WaitWindowEvent() If ev=#WM_MOUSEWHEEL If EventwParam()>0 SetGadgetText(0,"UP") ElseIf EventwParam()<0 SetGadgetText(0,"DOWN") EndIf EndIf Until ev=#PB_Event_CloseWindow EndIf
The idea looks good, but if one increases the bars, the ListIconGadget gets an horizontal scroll bar and the mouse wheel will scroll it (while showing 13 at a time).
Is there a way of using your code also on Linux and Mac and disabling the horizontal scroll bar from being affected by the mouse wheel?
Thank you!
- marcoagpinto
- Addict
- Posts: 939
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Keyboard shortcuts for mouse wheel
@Dude
Maybe, as a workaround, I could bind the mouse wheel scroll to the vertical scroll bar, so that when over it, it would scroll.
But, I still need to know how to get the wheel event to Linux and Mac.
Could you help?
Thank you, my friend!
Maybe, as a workaround, I could bind the mouse wheel scroll to the vertical scroll bar, so that when over it, it would scroll.
But, I still need to know how to get the wheel event to Linux and Mac.
Could you help?
Thank you, my friend!
Re: Keyboard shortcuts for mouse wheel
I don't use Linux or Mac, so I can't help further, sorry.
Re: Keyboard shortcuts for mouse wheel
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
- marcoagpinto
- Addict
- Posts: 939
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Keyboard shortcuts for mouse wheel
Now seriously,
Look at the help for the ScroolBarGadget():
What is the point of this, if it doesn't allow scroll with the mouse wheel?
Fred, could you take it as a feature request?
Thank you!
Look at the help for the ScroolBarGadget():
Code: Select all
Example: ScrollBar events
Procedure BindHScrollDatas()
SetWindowTitle(0, "ScrollBarGadget (" + GetGadgetState(0) + ")" )
EndProcedure
Procedure BindVScrollDatas()
SetWindowTitle(0, "ScrollBarGadget (" + GetGadgetState(1) + ")" )
EndProcedure
If OpenWindow(0, 0, 0, 400, 400, "ScrollBarGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TextGadget (2, 10, 25, 350, 30, "ScrollBar Standard (start = 50, page = 30/100)")
ScrollBarGadget (0, 10, 50, 350, 20, 0, 100, 30)
SetGadgetState (0, 50) ; set 1st scrollbar (ID = 0) to 50 of 100
TextGadget (3, 10, 120, 350, 30, "ScrollBar vertical (start = 100, page = 50/300)")
ScrollBarGadget (1, 175, 160, 25, 120 ,0, 300, 50, #PB_ScrollBar_Vertical)
SetGadgetState (1, 100) ; set 2nd scrollbar (ID = 1) to 100 of 300
BindGadgetEvent(0, @ BindHScrollDatas())
BindGadgetEvent(1, @ BindVScrollDatas())
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
Case #PB_Event_Gadget
Select EventGadget()
Case 0
MessageRequester("Info","The ScrollBar 0 has been used ! (" + GetGadgetState(0) +
")" ,#PB_MessageRequester_Ok)
Case 1
MessageRequester("Info","The ScrollBar 1 has been used ! (" + GetGadgetState(1) +
")" ,#PB_MessageRequester_Ok)
EndSelect
EndSelect
ForEver
EndIf
Fred, could you take it as a feature request?
Thank you!
Re: Keyboard shortcuts for mouse wheel
The code I posted above is no longer useful for 64bit PureBasic because it doesn't return negative or positive values for the wheel direction. Is there some sort of ">>" math trick to make it work again?