// look for keyboard shortcuts and clicking of objects bool checkKeys() { bool retval = true; if (menus.clicked != "") { return(true); } if (Input.GetMouseButtonDown(0) && !Input.GetKey(KeyCode.LeftAlt)) { // User clicked button (but not while naviaging via alt key //Debug.Log("clicked in checkKyes"); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit, 100)) { if (Input.GetKey(KeyCode.LeftShift)) { // user seeks information about an object functionBehaive funScript = (functionBehaive)hit.transform.gameObject.GetComponent(typeof(functionBehaive)); if (funScript != null) { funScript.showSummary(false, false); } else { Debug.Log("perhaps hit data? " + hit.transform.gameObject.name); dataBehaviorNew dataScript = (dataBehaviorNew)hit.transform.gameObject.GetComponent(typeof(dataBehaviorNew)); if (dataScript != null) { dataScript.showSummary(); addressLabel = "address: 0x" + dataScript.address.ToString("x"); } } } else { // if function is clicked, zoom to it. Debug.Log("HIT SOMETHING " + hit.transform.gameObject.name); functionBehaive funScript = (functionBehaive)hit.transform.gameObject.GetComponent(typeof(functionBehaive)); if (funScript != null) { cameraScript.setObject(funScript.function.getPosition()); } } } } else if (Input.GetMouseButtonUp(0)) { addressLabel = ""; } else if (Input.GetKeyDown("space")) { doUserPause(); //print("space key was pressed"); //}else if (Input.GetKeyDown("escape")){ // //print("escape key was pressed"); // helpString = null; // //cameraScript.restore(); // setCamera(); } else if (Input.GetKeyDown("w") && Input.GetKey(KeyCode.LeftShift)) { cameraScript.moveZ(1); } else if (Input.GetKeyDown("s") && Input.GetKey(KeyCode.LeftShift)) { cameraScript.moveZ(-1); } else if (Input.GetKeyDown("w")) { cameraScript.moveY(1); } else if (Input.GetKeyDown("s")) { cameraScript.moveY(-1); } else if (Input.GetKeyDown("a")) { cameraScript.moveX(1); } else if (Input.GetKeyDown("d")) { cameraScript.moveX(-1); // }else if (Input.GetKeyDown("r") && (Input.GetKey (KeyCode.LeftShift) || Input.GetKey (KeyCode.RightShift))){ } else if (Input.GetKeyDown("r") && (Input.GetKey(KeyCode.LeftShift))) { if (!justShowData) { justShowData = true; skipToData = true; pauseLabelString = "skipping"; } else { justShowData = false; } } else if (Input.GetKeyDown("f")) { manageControl.follow(!manageControl.following()); } else if (Input.GetKeyDown("r")) { if (isPlaying) { skipToData = true; pauseLabelString = "skipping"; //Debug.Log("Skip to data at clock "+currentClock); } } else if (Input.GetKeyDown("h")) { setCamera(); } else if (Input.GetKeyDown("i")) { if (!skipToNetwork) { justShowData = true; skipToData = true; pauseLabelString = "skipping"; } else { justShowData = false; skipToData = false; if (!userPause) { pauseLabelString = "play"; } } skipToNetwork = !skipToNetwork; } else if (Input.GetKeyDown("b")) { pause(true); userStackFrame = manageControl.callStack.Count - 1; functionDatabase.functionItem fi = manageControl.currentFunction; cameraScript.setObject(fi.getPosition()); if (functionLabels) { fi.script.showSummary(true, true); } } else if (Input.GetKeyDown("n") && (Input.GetKey(KeyCode.LeftShift))) { if (userStackFrame < manageControl.callStack.Count - 1) { functionDatabase.functionItem fi = manageControl.callStack[userStackFrame]; cameraScript.setObject(fi.getPosition()); userStackFrame++; if (functionLabels) { fi.script.showSummary(true, true); } } } else if (Input.GetKeyDown("n")) { if (userStackFrame >= 0) { functionDatabase.functionItem fi = manageControl.callStack[userStackFrame]; cameraScript.setObject(fi.getPosition()); if (userStackFrame > 0) { userStackFrame--; } if (functionLabels) { fi.script.showSummary(true, true); } } } else if (Input.GetKeyDown("m")) { pause(true); menus.clicked = "create bookmark"; //createBookmark(); } else if (Input.GetKeyDown("l")) { pause(true); menus.clicked = "goto bookmark"; } else { retval = false; } return(retval); }