Numpad -> Photoshop Shortcuts

Announcements, questions
Post Reply
JimStas
Posts: 1
Joined: 11 Nov 2022, 12:36

Numpad -> Photoshop Shortcuts

Post by JimStas » 11 Nov 2022, 13:23

Hello, I apologize in advance for my lack of understanding how all of this works!

So, here we go.
I' have purchased a Numpad with the intention to remap all the buttons to photoshop shortcuts while doing digital art on my graphics tablet
This means I have no space so I cant use my regular keyboard alongside it.

I first tried Sharpkeys which works perfectly but it doesn't distinguish between keyboards and therefore breaks the functionality of my primary keyboard and requires a windows log off or a restart to bring things to normal.

Then I tried HIDMacros which seemed to be what I was looking for but cant simulate holding down a key
Holding down CTRL, SHIFT, ALT, SPACE and R is essential in photoshop

So I transitioned to luaMacros but I can't find a way to keep the keys pressed but another problem has surfaced as well
evrey time I press a button, both the original and the remapped keystrokes happen

Any help would be appreciated!

This is my code (The PTTToggled was something I found on the forum but I either did something wrong or it's not working):

Code: Select all

lmc_device_set_name('Numpad','33816645')

lmc_set_handler('Numpad',function(button, direction)
lmc.minimizeToTray = true
lmc_minimize()

--Initialise PTTToggled
PTTToggled = false

  if (direction == 1) then return end  -- ignore down
  if (button == 96) then
    lmc_send_keys('^', 50)

    elseif (button == 27) then
    lmc_send_keys('B', 50)

    elseif (button == 9) then
    lmc_send_keys('E', 50)

    elseif (button == 8) then
    lmc_send_keys('S', 50)

    elseif (button == 144) then
    lmc_send_keys('[', 50)

    elseif (button == 111) then
    lmc_send_keys(']', 50)

    elseif (button == 106) then
    lmc_send_keys('^0', 50)

    elseif (button == 109) then
    lmc_send_keys('^1', 50)

    elseif (button == 36) then
    lmc_send_keys('^Z', 50)

    elseif (button == 38) then
    lmc_send_keys('^+Z', 50)

    elseif (button == 33) then
    lmc_send_keys('{F8}', 50)

    elseif (button == 107) then
    lmc_send_keys('{ESCAPE}', 50)

    elseif (button == 37) then
    lmc_send_keys('^-', 50)

    elseif (button == 12) then
    lmc_send_keys('^=', 50)

    elseif (button == 39) then
    lmc_send_keys('R', 50)

   --elseif (button == 40) then
   --lmc_send_keys(' ', 50)

    elseif (button == 34) then
    lmc_send_keys('{F9}', 50)

    elseif (button == 13) then
    lmc_send_keys('{ENTER}', 50)

   end

    if (button == 97 and direction == 0) then
	PTTToggled = not PTTToggled

        if (PTTToggled) then
        lmc_send_keys('+', 0, 0)

        else
        lmc_send_keys('+', 0, 2)

        end
    end

    if (button == 45 and direction == 0) then
	PTTToggled = not PTTToggled

        if (PTTToggled) then
        lmc_send_keys('+', 0, 0)

        else
        lmc_send_keys('+', 0, 2)

        end
    end

    if (button == 46 and direction == 0) then
	PTTToggled = not PTTToggled

        if (PTTToggled) then
        lmc_send_keys('+', 0, 0)

        else
        lmc_send_keys('+', 0, 2)

        end
    end


  --else print('Not yet assigned: ' .. button) 1
end)

Post Reply