Samsung Galaxy Book discussion thread

Discussion in 'Samsung' started by JoeS, Feb 26, 2017.

  1. dimos15

    dimos15 Pen Pal - Newbie

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    I have the same bug ....galaxy book 12
     
  2. 2ndHouse

    2ndHouse Pen Pal - Newbie

    Messages:
    18
    Likes Received:
    9
    Trophy Points:
    6
    I'm away from my GB 12 at the moment, has anyone had a chance to test this script yet? Wondering if it works better than the other script that is already out there. The previous script did not work in all programs, couldn't get right click to work in Chrome or Clip Studio for example.
     
    thatcomicsguy likes this.
  3. thatcomicsguy

    thatcomicsguy Pen Pro - Senior Member Senior Member

    Messages:
    3,110
    Likes Received:
    2,145
    Trophy Points:
    231

    Thank-you for sharing! This was a nice post to start my evening with!

    Still needing to be solved: In ClipStudio, the brush re-size function stops working after the first few uses. (Hold button and move nib to resize). I experienced the same problem with the original AHK script, so still find myself using RadialMenu. -Too bad, since AHK makes possible a much cleaner and tighter solution.

    It also has some odd performance glitches when right-clicking on items in the Windows 10 start menu, -but at least it does activate them; RadialMenu for some reason does nothing in the Start Menu. It's like Windows does that in some high priority process or something...

    Either way, this should be stickied at the front end of this thread.


    Cheers!
     
  4. DRTigerlilly

    DRTigerlilly Tablet Lead Mod (Retired) Super Moderator

    Messages:
    7,385
    Likes Received:
    604
    Trophy Points:
    301
    @Piton812 One request could the parts of the script in Russian please be translated to English.
     
  5. ConfusedStylus

    ConfusedStylus Pen Pal - Newbie

    Messages:
    13
    Likes Received:
    4
    Trophy Points:
    6
  6. Piton812

    Piton812 Pen Pal - Newbie

    Messages:
    15
    Likes Received:
    17
    Trophy Points:
    6
    I translate the comments of the script, here is the link on "ready to use" ahk file with English comments.
    https://yadi.sk/i/Vzb6__fNv8Iy2g
    and here is content of the sript:
    ; Terms used for right button: "Pressed" and "Released"
    SendMode Input
    SetWorkingDir %A_ScriptDir%
    ; Set up our pen constants
    global PEN_HOVERING := 0 ;Pen is moved away from screen
    global PEN_TOUCHING := 1 ;Pen is touching screen
    global PEN_BTN_HOVERING := 8 ;Button is pressed with pen is away from screen
    global PEN_BTN_TOUCHING := 12 ;Button is pressed with pen is touching screen
    global sPen_Thread := 0 ;State of the flow
    ;global sPen_Timer := 0 ;State of the timer
    global sPen_RBtn := 0 ;This thing keep the last tracking state
    ; Send Alt, Ctrl and Shift keys along with the right-click if
    ; necessary
    SendModifierKeys() {
    static lastAlt := 0
    static lastCtrl := 0
    static lastShift := 0
    AltState := GetKeyState("Alt")
    CtrlState := GetKeyState("Ctrl")
    ShiftState := GetKeyState("Shift")
    if (AltState <> lastAlt) {
    if (AltState)
    {
    Send {Alt Down}
    } else {
    Send {Alt Up}
    }
    lastAlt := AltState
    }
    if (CtrlState <> lastCtrl) {
    if (CtrlState) {
    Send {Ctrl Down}
    } else {
    Send {Ctrl Up}
    }
    lastCtrl := CtrlState
    }
    if (ShiftState <> lastShift) {
    if (ShiftState) {
    Send {Shift Down}
    } else {
    Send {Shift Up}
    }
    lastShift := ShiftState
    }
    }
    TimerThreadEnd(){
    SetTimer, TimerThreadEnd, Off
    sPen_Thread := 0 ;Mark that flow is off
    if (sPen_RBtn <> 0){ ;Button still pressed
    SendModifierKeys()
    Send {RButton Up} ;Say that right button is released
    }
    }
    TimerThreadOn(){
    sPen_Thread := 1 ;Flow is active
    SetTimer, TimerThreadEnd, 30 ; 30 millisecond
    }
    #include AHKHID.ahk
    WM_INPUT := 0xFF
    USAGE_PAGE := 13
    USAGE := 2
    AHKHID_UseConstants()
    AHKHID_AddRegister(1)
    AHKHID_AddRegister(USAGE_PAGE, USAGE, A_ScriptHwnd, RIDEV_INPUTSINK)
    AHKHID_Register()
    OnMessage(WM_INPUT, "Work")
    Work(wParam, lParam) {
    Local type, inputInfo, inputData, raw, proc
    static lastInput := PEN_NOT_HOVERING
    Critical
    type := AHKHID_GetInputInfo(lParam, II_DEVTYPE)
    if (type = RIM_TYPEHID) {
    inputData := AHKHID_GetInputData(lParam, uData)
    TimerThreadOn() ;Monitoring(tracking) the commands flow
    raw := NumGet(uData, 0, "UInt")
    proc := (raw >> 8) & 0x1F
    ;0 - hovering
    ;1 - point
    ;8 - hovering + btn
    ;12 - point + btn
    if (proc <> lastInput) {
    if (proc == PEN_BTN_HOVERING){ ;Button is pressed + move near the screen
    sPen_RBtn := 1 ;Consider that this state is a right button pressed act on device
    SendModifierKeys()
    Send {RButton Down} ;Say that button is pressed
    }else{
    if (lastInput == PEN_BTN_HOVERING){ ;Till this moment button was pressed + moved near the screen
    SendModifierKeys()
    Send {RButton Up} ;Sy that right button released
    }
    sPen_RBtn := 0 ;This is not right button mouse anymore
    }
    lastInput := proc
    }
    }
    }

    I update the instruction (little modification in "step 2")

    1 - Download AutoHotKey. I recommend portable version no need to install (download "AutoHotkey.zip" from official site https://autohotkey.com/)

    2 - Get the script. For this download the "ready to use" script file from this link:
    https://yadi.sk/d/B0r1xg91__XJWw
    And Put the script to the same folder where your Autohotkey folder is

    3. - Download the library file "AHKHID.ahk" and put it in same folder where your Autohotkey folder is (download it from https://github.com/jleb/AHKHID/)

    4. - Now you have to run the script using Autohotkey app. To do that: right click on the script file you get on step 2 (script name "spen_by_Serega.ahk"). In context menu choose "properties" in next menu choose "Change" button where "Open with" is and in the next menu in the bottom choose"More apps" and then choose "Look for another app on this PC" and then you have to choose the folder "Autohotkey_1.1.30/00" and in this folder choose file "AutohotkeyU64.exe" then in the menu choose "apply" and "OK".

    4.1. - Just make double left clik on script file to run it. In right bottom corner of you screen you'll see the green Autohotkey icon that means that scripts works and now your S-pen button works the same way as right mouse button.

    5. Enjoy
     
    DRTigerlilly likes this.
  7. Piton812

    Piton812 Pen Pal - Newbie

    Messages:
    15
    Likes Received:
    17
    Trophy Points:
    6
    Thanx for review! Next week I'll ask my friend to see the code about problems you discribe. I'll give you know if there will be modifications of the script solving those issues.
     
    Shizaru likes this.
  8. thatcomicsguy

    thatcomicsguy Pen Pro - Senior Member Senior Member

    Messages:
    3,110
    Likes Received:
    2,145
    Trophy Points:
    231
    Samsung doesn't make it easy, that's for sure! But at least they offer a 2-in-1 with a Wacom digitizer. Without it's existing, we'd be stuck having to get an official Wacom MSP for twice the price, less reliability and no keyboard. The art tablet market is a weird place with lots of walls, but there are a few cracks here and there where the sunlight gets in.

    Anyway, this driver will work:

    http://download.microsoft.com/downl...-8059-E54C91C564A9/Wintab-1.0.0.18-64-bit.zip
     
    Last edited: Nov 3, 2018
    WillAdams likes this.
  9. LeoZappa

    LeoZappa Pen Pal - Newbie

    Messages:
    28
    Likes Received:
    32
    Trophy Points:
    16
    This is very nice! But all AHK scripts I have seen so far, including this one, as well as Radialmenu, fail to work for UWP apps. This probably goes unoticed here as most people are artists. But I'm mostly working in Onenote and Drawboard...

    What happens is that UWP apps treat mouse and stylus position as independent, so when you use these scripts you trigger a right mouse event, but at the location where the mouse last was, rather than the current location of the pen!! One would need to also decode the AHKHID raw data comeing from the pen to determine its current position, and then move th emouse at that positino before triggering the right mouse button event....
     
    JoeS, Piton812 and thatcomicsguy like this.
  10. ConfusedStylus

    ConfusedStylus Pen Pal - Newbie

    Messages:
    13
    Likes Received:
    4
    Trophy Points:
    6

    Thanks you've been such a helpful resource on these forums. It was so much research to find the perfect tablet but yes I did decide on Wacom EMR being the best right now. There IS that HP thing but it was on sale for $1200. This was even cheaper.
     
Loading...

Share This Page