So here's what I'm trying to do. I tried to write it myself, but it was too complicated, so I gave up lol
So I'm using OneNote, and I bought a pen tablet (CTL-472) for online teaching. I want to use my pen to pan freely/ in any direction (without using the scroll wheel because it only lets you scroll up, down, left, and right), but my pen doesn't have that feature. So my idea is... you know how when you put two fingers on your laptop's trackpad you can pan around the canvas/page by moving them any direction you want? I want to do that, but with my pen. So is there any way I can somehow remap those trackpad gestures to my pen, and activate it by pressing LShift?
Thanks, everyone.
Panning With Tablet's Pen Using Trackpad Gestures Topic is solved
Re: Panning With Tablet's Pen Using Trackpad Gestures
Does the two-finger gesture usually work in OneNote? If not, what is the usual method for panning in OneNote? When the panning happens, is it actually moving an entire window?
Below is a way to move a window with LShift.
Below is a way to move a window with LShift.
Code: Select all
LShift:: ; Move the active window
WinRestore, % "ahk_id " WinActive("A")
CoordMode, Mouse
MouseGetPos, mxOrig, myOrig ; Get initial mouse position
WinGetPos, wxOrig, wyOrig, width, height ; Get active window's position
While GetKeyState(A_ThisHotkey, "P") {
Sleep, 10
MouseGetPos, mxNew, myNew
newX := wxOrig + mxNew - mxOrig, newY := wyOrig + myNew - myOrig
WinMove, newX, newY ; Adjust position according to mouse distance moved
}
WinMove,,,,, Min(width, A_ScreenWidth - newX), Min(height, A_ScreenHeight - newY)
Return
Re: Panning With Tablet's Pen Using Trackpad Gestures
Yes, it works anywhere. And what I mean by pan is panning the canvas or the screen inside that window.
I can't explain it well here, so here's a video to clarify it more. I'm sorry for the bg noise.
https://streamable.com/afjxhu
I can't explain it well here, so here's a video to clarify it more. I'm sorry for the bg noise.
https://streamable.com/afjxhu
Re: Panning With Tablet's Pen Using Trackpad Gestures Topic is solved
The following worked for me.
I added Panning Hand and Select Objects to Quick Access Toolbar. This gives you keyboard shortcuts. For me, I had Alt+7 for panning hand, and Alt+8 for selecting objects. I was then able to use my LShift and mouse to pan a drawing. You might need some adjustments for your device.
I added Panning Hand and Select Objects to Quick Access Toolbar. This gives you keyboard shortcuts. For me, I had Alt+7 for panning hand, and Alt+8 for selecting objects. I was then able to use my LShift and mouse to pan a drawing. You might need some adjustments for your device.
Code: Select all
#IfWinActive ahk_exe ONENOTE.EXE
LShift::
SoundBeep, 1500, 30
Send {Alt}7
Click, D
KeyWait, LShift
Click, U
Send {Alt}8
SoundBeep, 1000, 30
Return
#IfWinActive
Re: Panning With Tablet's Pen Using Trackpad Gestures
The panning hand tool disables as soon as it detects my pen. It only works with my mouse.
Re: Panning With Tablet's Pen Using Trackpad Gestures
OK. Maybe there is a way to re-enable it. I do not have a way to test it. Others here may know more.
Re: Panning With Tablet's Pen Using Trackpad Gestures
It worked! I just have to disable and re-enable the windows ink option on the settings of my pen tablet. Thank you!mikeyww wrote: ↑13 Mar 2021, 14:04The following worked for me.
I added Panning Hand and Select Objects to Quick Access Toolbar. This gives you keyboard shortcuts. For me, I had Alt+7 for panning hand, and Alt+8 for selecting objects. I was then able to use my LShift and mouse to pan a drawing. You might need some adjustments for your device.
Code: Select all
#IfWinActive ahk_exe ONENOTE.EXE LShift:: SoundBeep, 1500, 30 Send {Alt}7 Click, D KeyWait, LShift Click, U Send {Alt}8 SoundBeep, 1000, 30 Return #IfWinActive
Re: Panning With Tablet's Pen Using Trackpad Gestures
Oh, it worked, but the pen pressure's gone.
Re: Panning With Tablet's Pen Using Trackpad Gestures
Good to hear the updates. I'm not sure whether there's something that can be done about the pressure issue (I have not tried to do that). Best of luck!
-
- Posts: 1
- Joined: 28 Nov 2021, 10:50
Re: Panning With Tablet's Pen Using Trackpad Gestures
I'm really appreciated your work. This post has a similar concept to mine, but I don't have the background of technology to code by myself. My idea is to use the button on my stylus pen to pan horizontally in OneNote, which can't be done due to the restriction of the program. Can you help me with this?
Re: Panning With Tablet's Pen Using Trackpad Gestures
I have a new version of OneNote that no longer works with this approach. Others may be able to help.
Who is online
Users browsing this forum: Google [Bot] and 181 guests