New setting idea

  • AlexFinn
    7th February Member 0 Permalink

    I need a thing where if you press shift you get line mode but don't have to hold it and it can be like water equalisation were you can turn it on and off i just thought about it because

    My carpal tunnel in my right now feels bad and tense please help

  • Tadpole1
    7th February Member 0 Permalink

    I don't know.Sometimes the Ctrl gets stuck,even though I didn't see any problem in the key.The icons just turn white,and I keep drawing rectangles.I then have to press Ctrl again to stop it.

  • Dragonrster
    7th February Member 0 Permalink

    I wrote a simple Shift-lock function in Lua for you. Please note: it's very basic, so you must turn the lock off when you want to select elements normally.

    if StickyLineDraw then
        return
    end
    StickyLineDraw = true
    
    local a = false
    local b = false
    local c, d = 0, 0
    local e, f = 0, 0
    
    local function g(h, i, j, k, l, m)
        if not j and (i == 225 or i == 229 or h == 16) then
            a = not a
            tpt.log("Sticky line mode: " .. (a and "ON" or "OFF"))
        end
    end
    
    local function n(o, p, q)
        if q == 1 and a then
            b = true
            c, d = o, p
            e, f = o, p
            return false
        end
    end
    
    local function r(o, p, s, t)
        if b and a then
            e, f = o, p
        end
    end
    
    local function u(o, p, q, v)
        if b and a and q == 1 then
            b = false
            local w, x = tpt.brushx, tpt.brushy
            local y = tpt.brushID
            sim.createLine(c, d, o, p, w, x, nil, y)
            return false
        end
    end
    
    local function z()
        if a then
            tpt.drawtext(10, 20, "Line mode locked", 255, 255, 0)
        end
        if b and a then
            local w, x = tpt.brushx, tpt.brushy
            tpt.drawline(c, d, e, f, 255, 255, 255, 120)
            for t = -x, x do
                tpt.drawline(c, d + t, e, f + t, 255, 255, 255, 40)
            end
            for s = -w, w do
                tpt.drawline(c + s, d, e + s, f, 255, 255, 255, 40)
            end
            tpt.fillrect(c - w, d - x, w * 2, x * 2, 0, 255, 0, 100)
            tpt.fillrect(e - w, f - x, w * 2, x * 2, 255, 0, 0, 100)
        end
    end
    
    event.register(event.keypress, g)
    event.register(event.mousedown, n)
    event.register(event.mousemove, r)
    event.register(event.mouseup, u)
    event.register(event.tick, z)
    
  • MachineMan
    7th February Member 0 Permalink

    Or you can start the brush at just 1 pixel by one pixel, then hold shift or ctrl will scrolling up with your mouse wheel to only extend the brush's length or width respectively.  With this method, you can draw entire lines either horizontal or vertical with just the click of a mouse, instead of having to hold and drag the mouse.

    Edited once by MachineMan. Last: 7th February
  • AlexFinn
    8th February Member 0 Permalink

    I Use a Trackpad because I don't have a charger for the mouse

    EDIT:

    @Dragonrster (View Post)

     Thank you so much I'm going to use that as soon as I can!

    Edited once by AlexFinn. Last: 8th February
  • jacob1
    8th February Developer 0 Permalink
    If you're on Windows you can also use sticky keys. It's made for situations like this. It is global though and applies everywhere.

    I think this is a good accessibility feature, I just wonder if the system accessibility features are good enough or if a TPT-specific version is needed.
  • AlexFinn
    8th February Member 0 Permalink

    @Dragonrster (View Post)

     Also how do you turn it off? 

    EDIT: For some reason it doesn't work well do oh I just looked at your message my problem is when I press shift for line tool I have to hold it which makes my thumb feel like spagettii, as if it's to far I have to guess by the line thing that i'm not going off the line but still thank you it helped a good bit

    Edited once by AlexFinn. Last: 8th February
  • Dragonrster
    10th February Member 0 Permalink

    @AlexFinn (View Post)

    To turn it off, simply press Shift again; to completely disable the script, you need to delete it.

  • AlexFinn
    11th February Member 0 Permalink

    I was able to stop it by opening powder toy again and killing the old one but my problem is my hand hurts when me use the line tool as have to hold shift and hold down on my trackpad which hurts my hand and makes me unable to make stright [english is bad] lines

  • ALumpOfPowderToy
    16th February Member 0 Permalink

    @AlexFinn (View Post)

     You can use alt (or option on mac) to make a perfectly straight line.