This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Rangicus's profile picture

Using Rctrl

Started by Rangicus, 17 September 2013 - 03:01 PM
Rangicus #1
Posted 17 September 2013 - 05:01 PM
Is there any way I can use Right control instead of left in computercraft? Myne is busted.
Yevano #2
Posted 17 September 2013 - 05:32 PM
You could detour the os.pullEvent function to have it return the left-control key code when it gets the right-control keycode. Something like this:


local oldPullEvent = os.pullEvent
function os.pullEvent(e)
    local eventData = oldPullEvent(e)
    if eventData[1] == "key" and eventData[2] == (whatever your leftctrl keycode is) then
        eventData[2] = (whatever your rightctrl keycode is)
    end
    return unpack(eventData)
end
Rangicus #3
Posted 17 September 2013 - 05:57 PM
Oh you misunderstood, I mean in computer craft (eg when it says "press ctrl to open menu") it doesnt work with rctrl and I was wondering how i could fix it
Yevano #4
Posted 17 September 2013 - 06:39 PM
Oh you misunderstood, I mean in computer craft (eg when it says "press ctrl to open menu") it doesnt work with rctrl and I was wondering how i could fix it

I didn't. Running the code I gave you in startup should change the key events to trick programs into thinking you are pressing lctrl, instead of rctrl. To my knowledge, the fact that edit doesn't accept rctrl for the menu selection isn't a bug.
Rangicus #5
Posted 18 September 2013 - 06:29 PM
Oh, thanks.