CC: Tweaked

CC: Tweaked

57M Downloads

Keys that coincide with CC shortcuts cannot be detected by computers while Ctrl is held

Kan18 opened this issue ยท 2 comments

commented

Minecraft Version

1.19.x

Version

1.102.2 (SC modpack)

Details

On 1.12, computers were able to detect when Ctrl+S, Ctrl+R, Ctrl+T, or any other key with Ctrl was held via the key event.

1_12_2_behavior.mp4

On 1.19, this no longer seems to be the case; computers can detect other keys when Ctrl is held, but not S, R, or T.

1_19_3_behavior.mp4

Is this intentional? It seems to be caused by this which was put in at f9e13ca (1.13). Some old 1.12 programs used Ctrl+S as a keybinding (to save something to disk, or to dispense one stack of an item). If this is intentional, it probably should be documented somewhere.

commented

Yeah, it's not really clear to me what the intended behaviour is here.

Back in CC 1.2 (when these keyboard shortcuts were added), key events would be queued for the first 0.5s after one of those shortcuts were pressed.

public void keyTyped(char ch, int key)
  super.keyTyped(ch, key);
  if (m_terminateTimer < 0.5F && m_rebootTimer < 0.5F) m_computer.keyTyped(c, k); 
}

However, in CC 1.76 the time Ctrl+S needed to be held for was reduced to 0.5s, and similarly the delay before key events aren't queued was reduced to 0s.

However, the timer for the various shortcuts is started in the update method, which is (IIRC) called after keyTyped - hence the event being queued once.


Kinda moot - I think we can just increase the delay to 0.2s or something - just love an excuse to go through old versions.

commented

With the buttons on the GUI, I would be tempted to remove the shortcuts altogether. Or at least have them implemented in Lua so that people have the option to customise them (even if via custom bios or shell)