Repeated is set to true on the first press of a key (SOLVED)

#1

A colleague noticed this today (not sure if it’s new or an old bug, or if it’s a bug at all), but apparently, the first event you get for a key press (pressed = true), also happens to have repeated = true:

Here’s the logs for a short spacebar press:

DEBUG:SCRIPT: hash: [space],
{ --[[0x10b642d60]]
  value = 1,
  repeated = true, -- This probably shouldn't be here
  released = false,
  pressed = true
}
DEBUG:SCRIPT: hash: [space],
{ --[[0x10b6431c0]]
  value = 1,
  repeated = false,
  released = false,
  pressed = false
}
DEBUG:SCRIPT: hash: [space],
{ --[[0x10b6435d0]]
  value = 1,
  repeated = false,
  released = false,
  pressed = false
}
DEBUG:SCRIPT: hash: [space],
{ --[[0x10b6439e0]]
  value = 1,
  repeated = false,
  released = false,
  pressed = false
}
DEBUG:SCRIPT: hash: [space],
{ --[[0x10b643df0]]
  value = 1,
  repeated = false,
  released = false,
  pressed = false
}
DEBUG:SCRIPT: hash: [space],
{ --[[0x10b644200]]
  value = 0,
  repeated = false,
  released = true,
  pressed = false
}
1 Like

#2

On all platforms?

0 Likes

#3

Confirmed on Windows and macOS

1 Like

#4

I took a look at the code and we do explicitly set repeated to true on press. I’m not sure what the reasoning for this is. Is this causing you a problem?

0 Likes

#5

No, it’s not causing us any problems. It just seems semantically wrong.

0 Likes