Log In  

Is there a way to adjust how quickly held keys repeat keypresses within the code editor, etc? It appears Pico-8 applies its own setting/behavior to this, it does not inherit it from the host operating system. I like to use very fast key repeat settings, in general. In particular it would be nice for using page up/page down to navigate a large program.

P#41582 2017-06-13 12:22 ( Edited 2018-08-11 16:50)

:: enargy
1

I think you have to roll your own, using btn() (instead of btnp()) and a timer..

Here's a quick example of that:

Cart #41583 | 2017-06-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

(This will make an image appear at each keypress. If the button is held for 2 seconds, then it will start spawning images again at a rate of 6 per second until you release the key)

P#41584 2017-06-13 13:34 ( Edited 2017-06-13 17:35)

I mean for the editor specifically.

P#41586 2017-06-13 13:44 ( Edited 2017-06-13 17:47)
:: enargy

Yeah oops, I made a complete fail at reading comprehension there. In that case.. I don't think you can adjust that.

Alt+up/down will jump between functions and ctrl+up/down will go to the top/bottom of the document. Not what you're looking for, but maybe that will help.

P#41587 2017-06-13 13:53 ( Edited 2017-06-13 17:53)

It's actually not bad as is, I'm just used to having it turned all the way to max on any OS I use, for text editing. Usually programs containing text editors inherit this property from the OS somehow.

P#41589 2017-06-13 13:57 ( Edited 2017-06-13 17:57)

I too would like the key repeat speed to inherit the OS, or at least to be able to change it. It's too slow for now.

@enargy is right about alt+up/down to access previous/next function. So my tip to easily browse your code: sort your functions alphabetically. Plus, that's a good excuse to gather and name functions by the entities they're managing. :)

P#41591 2017-06-13 16:01 ( Edited 2017-06-13 20:01)
:: P.O.

New user chiming in - I too would love for this to be fixed.

It is especially frustrating considering that character input does seem to follow the OS settings for Repeat Delay and Repeat Rate, and so does backspace ; but directional arrows seem to have their own settings overriding the OS preferences, replacing them with very sluggish values. It gets tiring very fast ...

P#44328 2017-09-18 18:24 ( Edited 2017-09-18 22:27)

this doesn't actually fix the issue, but you CAN use external text editors with pico-8.

I use VSCode most of the time.

P#44329 2017-09-18 20:07 ( Edited 2017-09-19 00:07)
:: P.O.

Indeed yeah - I ended up settling for UltraEdit for serious sessions while on my main machine, and native Pico8 editing while on the laptop.

Still, it's a shame that keyrepeat for directional keys is currently not following the OS setting while everything else does, as that would be a net benefit for everyone. It's definitely a bug, so hopefully that'll get fixed.

P#44401 2017-09-20 18:12 ( Edited 2017-09-20 22:13)

I would also like the arrow keys inside the editor to use the host key repeat rate like the rest of the keys, unless there's a good reason for them not to.

P#54953 2018-08-11 12:39 ( Edited 2018-08-11 16:40)
:: dw817

That would be nice to change the key repeat speed in the editor.

Would it be so bad to use the default as set in your OS (Windows), ZEP ?

When I found how slow repeat was for BTNP(), I initially wrote my code for custom keystrokes. (Key1, pause) (Key2, pause) then (Fast repeat).

Here is some sample code:

-- custom key repeat example
-- from the lab of dw817

-- custom key repeat

x=58 y=58 b={}

repeat
  cls()
  circfill(x,y,16)
  flip()
  for i=0,3 do
    if btn(i)==false then
      b[i]=0
    else
      b[i]+=1
    end
    if b[i]==1 or b[i]==8 or b[i]>16 then
      if (i==0) x-=1
      if (i==1) x+=1
      if (i==2) y-=1
      if (i==3) y+=1
    end
  end
until forever
P#54954 2018-08-11 12:50 ( Edited 2018-08-11 23:34)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2019-12-13 20:44 | 0.030s | 4194k | Q:45