New Entity

Draft 1.1:
Index


Source Code: interactionsXY.js



Purpose: Generate XY-driven outputs

Additional Usage: Build in default pointer values for complex visual-spatial environments that are able to be mapped to system resources such as the GPU, RAM, or CPU. None of these extensions are provided, but many suitable methods and packages already exist to get someone started.

            
// Copyright (C) 2020 New Entity Operations Inc.
// All Rights Reserved
// interactionsXY.js
// https://www.NewEntity.io/section/4/
// interactionsXY.js
// Version 0.6 (12/28/2020)
// Establish a default region
let regionX = 0;
let regionY = 0;

function provideXYInformation(event) {
  var xAxis = event.clientX;
  var yAxis = event.clientY;
  var makeVectorObjectXY = "X-Axis: "+xAxis+", and the Y-Axis: "+yAxis;
  regionX = xAxis;
  regionY = yAxis;
  // console.log(makeVectorObjectXY);
}

function responseXYEvent () {
  // Define protected or special response regions
  if (regionX > 50 & regionY > 50) {
    match = 0;
  } else {
    match = 1;
  }

  if (match == 0) {
    // basic movement detetched, but no matched element
    //console.log("Event: Mouse->STATUS: "+eventMouse);
  } else if (match == 1) {
    // if active region is specified areas, return more. This person is really interacting!
    //console.log("Event: MouseOver->SPECIALTY STATUS: "+eventMouseOver);
  } else {
    //console.log("Event: Undefined");
  }
}
// holdState with the required variables to disengage protected key portions
let hasProtectedRegionalState = 0;
let stateInputNow = 0;
let stateTextareaNow = 0;
// Provide two defaults that will disengage the default key operators
function onActiveKillInputContactHere (event) {
  // console.log("AKICH: e");
  if (stateInputNow == 0) {
    hasProtectedRegionalState = 1;
    // console.log("Protected State: AKICH Active");
  } else {
    hasProtectedRegionalState = 0;
    // console.log("Protected State: AKICH Inactive");
  }
}
// Provide two defaults that will disengage the default key operators
function onActiveKillInputName (event) {
  // console.log("AKIN: e");
  if (stateInputNow == 0) {
    hasProtectedRegionalState = 1;
    // console.log("Protected State: AKIN Active");
  } else {
    hasProtectedRegionalState = 0;
    // console.log("Protected State: AKIN Inactive");
  }
}
function onActiveKillTextarea (event) {
  // console.log("AKT: e");
  if (stateTextareaNow == 0) {
    hasProtectedRegionalState = 1;
    // console.log("Protected State: AKT Active");
  } else {
    hasProtectedRegionalState = 0;
    // console.log("Protected State: AKT Inactive");
  }
}
try {
  const inputsName = document.querySelector('input[name="contact_here"]');
  inputsName.addEventListener('focus', (event) => {
    onActiveKillInputContactHere(event);
  });
} catch (e) {
  // console.log("Working On input: 0");
}
try {
  const inputsName = document.querySelector('input[name="name"]');
  inputsName.addEventListener('focus', (event) => {
    onActiveKillInputName(event);
  });
} catch (e) {
  // console.log("Working On input: 0");
}
try {
  const textareaAll = document.querySelector("textarea");
  textareaAll.addEventListener('focus', (event) => {
    onActiveKillTextarea(event);
  });
} catch (e) {
  // console.log("Working On textarea: 0");
}
function responseOperatorKey (event) {
  protectedPage = "https://www.newentity.io/protected"
  // Make redundant for the document overall, and the first pass through the document to evaluate inputs present
  if (document.URL == protectedPage) {
   let killRing = 1;
   // console.log("killRing: Up");
  }
  else {
    let killRing = 0;
    // console.log("killRing: Down");
  }
  if (killRing == 0) {
    var getEventInformation = event.key;
    if (hasProtectedRegionalState==0) {
      if (getEventInformation == "p") {
        window.location = startingPointPresentation;
        // console.log("Operator Key Activated: "+getEventInformation);
      } else if (getEventInformation == "h") {
        window.location = originPoint;
        // console.log("Operator Key Activated: "+getEventInformation);
      } else if (getEventInformation == "f") {
        window.location = favoritePoint;
        // console.log("Operator Key Activated: "+getEventInformation);
      } else {
      }
    } else if (hasProtectedRegionalState==1) {
     // console.log("You're currently within a protected region, no event esclation occuring. Falling back.");
    } else {
     // console.log("No state determination was able to be made.");
    }
  } else {
    // console.log("Not Clear: Protected document portions were entered.");
  }
}

function providesRegionXY () {
  // console.log("Region Established As-> RegionX: "+regionX+" and RegionY: "+regionY);
}
providesRegionXY();
// on mousemove, run event
// Actions Center
// Perform action and consider various legacy scenarios

if (document.addEventListener, legacy=ON) {
  // Active runner, extend as needed
  document.addEventListener("mousemove", (event) => {
    provideXYInformation(event);
    responseXYEvent();
    // console.log("XY Mode Supports Legacy?: "+legacy);
  });
  document.addEventListener("keypress", (event) => {
    responseOperatorKey(event);
    // console.log("XY Mode Supports Legacy?: "+legacy);
  });
} else if (document.attachEvent, legacy=ON) {
  // Branch browsers here as neededo
  // console.log("XY Mode Supports Legacy?: "+legacy+" dated browser engine, slowing...!");
  document.attachEvent("mousemove", responseXYEvent);
  document.attachEvent("keypress", responseOperatorKey);
}