From 069f1be89d870c0011ae05a31db3457e019bd76b Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Thu, 20 Nov 2014 22:48:03 -0600 Subject: [PATCH] jump with number keys to preset places --- examples/hotPlaces.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/hotPlaces.js diff --git a/examples/hotPlaces.js b/examples/hotPlaces.js new file mode 100644 index 0000000000..e674edde4b --- /dev/null +++ b/examples/hotPlaces.js @@ -0,0 +1,29 @@ +// +// hotPlaces.js +// +// Press the number keys to jump to different places in the metaverse! +// +// Created by Philip Rosedale on November 20, 2014 +// Copyright 2014 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 + + +function keyPressEvent(event) { + // if our tools are off, then don't do anything + if (event.text == "1") { + Window.location = "hifi://starchamber"; + } else if (event.text == "2") { + Window.location = "hifi://apartment"; + } else if (event.text == "3") { + Window.location = "hifi://rivenglen"; + } else if (event.text == "4") { + Window.location = "hifi://sanfrancisco"; + } else if (event.text == "5") { + Window.location = "hifi://porto"; + } else if (event.text == "6") { + Window.location = "hifi://hoo"; + } +} +Controller.keyPressEvent.connect(keyPressEvent); \ No newline at end of file