Want to remap your control scheme? (Keyboard)


#1

Hey people, I’m providing this script to anyone who would like to remap their controls.

http://hifi-content.s3.amazonaws.com/alexia/remapGameControls.js

// remapGameControls.js
//
// Created by Alexia Mandeville on 3/6/2018
// Copyright 2018 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//

// This script updates the control scheme for keyboard navigation.
// If you want to change any of the mappings, you can use our API reference for input devices here:
// https://docs.highfidelity.com/api-reference/namespaces/controller

// The name of the new mapping
var MAPPING_NAME = “com.highfidelity.controllers.remapGameControls”;

// Create a new mapping object
var mapping = Controller.newMapping(MAPPING_NAME);

// Remap //

// Let’s put jump and upfly on E…
mapping.from(Controller.Hardware.Keyboard.E).to(Controller.Actions.Up);

// and map downfly to C.
mapping.from(Controller.Hardware.Keyboard.C).to(Controller.Actions.Down);

// The next two mappings include modifiers! //

// Remap Shift + W to pitch the camera up.
mapping.from(Controller.Hardware.Keyboard.W).when(Controller.Hardware.Keyboard.Shift).to(Controller.Actions.PitchUp);

// Remap Shift + S to pitch the camera down.
mapping.from(Controller.Hardware.Keyboard.S).when(Controller.Hardware.Keyboard.Shift).to(Controller.Actions.PitchDown);

// Enable the new mapping.
Controller.enableMapping(MAPPING_NAME);

// Disable the new mapping when the script ends.
Script.scriptEnding.connect(function () {
Controller.disableMapping(MAPPING_NAME);
});

I made it in anticipation that some people may not prefer the new scheme. I do hope the new mapping allows you to move get where you’re going faster.

Let me know if you have any questions.


Beta Release 67
#2

I have not looked at keyboard mapping stuff for awhile now. One question that I can think of is: can I now remap Alt Left Click Drag to not copy objects? And can I now remap Right Click Drag? Also, what about the middle mouse button?

Like I said, I have not looked at keyboard mapping for awhile now so don’t mind me.


#3

I think you would need to change edit.js in order to change those controls. I’m not sure if it can be done with just the input-controller json.


#4

It would be good if the Create app could be changed to use, say, the Shift key for click-drag-duplicate instead of the Alt key. Using the Alt key conflicts with the inspect.js script.


#5

Hmm shift allows you to select multiple items. Do you need inspect.js while using create? You can select an entity, focus (with F), and zoom around it, right?


#6

The Create app’s camera control is lacking, I find. You don’t necessarily want to look directly at the entity being edited’s position. You may want to cam about to see how it looks in relation to other entities, from various points of view.

Is the Ctrl key free for multi-select? On Windows, it seems that it’s typically the Ctrl key that’s used for multi-select.


#7

I agree with @ctrlaltdavid here. Why reinvent the wheel. Ctrl is the common key for multi-select. It almost seems sometimes like things are being made harder for people to use here.


#8

While I do agree, we have the difficulty of using CTRL for menu shortcuts at the moment. Maybe we can get around it in the future, or maybe it wouldn’t actually be an issue with the Create app.

When I was redesigning the nav controls I ran into this. I had originally wanted CTRL for flying down, but it interfered with CTRL+A, CTRL+J, etc.

To be clear I haven’t yet thought about the Create app, but that’s not to say I don’t hear you (or feel your pain). I am keeping it in mind.


#9

And to be fair, ALT isn’t a great one either since it’s used for accessibility.

We have some complications to work with since we have so many different modes.


#10

Windows uses the Ctrl key for shortcuts as well as multi-select. The difference is whether after you press the Ctrl key, you press another key (i.e., shortcut) or mouse button (multi-select). Similar can probably be said for the Alt key.

The motivation behind not using the Alt key for mouse-click-drag-to-duplicate in the Create app is so that it can be used for camming by the inspect.js script without fear of duplicating an entity, etc. The inspect.js script’s camming is based on Second Life’s camera navigation - including pressing and holding different combinations of Ctrl and Shift while camming to alter camming behaviour (e.g., pan or zoom instead of orbit). This way of camming about is second nature to some people. (Though the inspect.js script could do with some improvements.)


#11

Maybe I missed the info, but is there a way to ‘run’ using the hand controllers?


#12

There is currently no way to ‘run’ (or go faster) using hand controllers.


#13

Is it planned to be ?


#14

We’re currently investigating locomotion (in VR), but I can’t comment on what our exact plans are. I don’t have any tangible info on it.

Sorry! I’ll keep ya posted.