Includes many handheld consoles.
779706
function DetectGameConsole()
   {
      if ($this->DetectSonyPlaystation() == $this->true) 
         return $this->true; 
      else if ($this->DetectNintendo() == $this->true) 
         return $this->true; 
      else if ($this->DetectXbox() == $this->true) 
         return $this->true; 
      else
         return $this->false; 
   }
1343397
def _treat_devices_removed(self):
        """"""
        for device in self._removed_ports.copy():
            eventlet.spawn_n(self._process_removed_port, device)
1076433
function(consoleService, moduleId, msg, cb) {
	let modules = consoleService.modules;

	let result = [];
	for (let moduleId in modules) {
		if (/^__\w+__$/.test(moduleId)) {
			continue;
		}

		result.push(moduleId);
	}

	cb(null, {
		modules: result
	});
}
847793
function UniversalCamera(name, position, scene) {
            var _this = _super.call(this, name, position, scene) || this;
            _this.inputs.addGamepad();
            return _this;
        }
1257442
function () {
    var gamepad = this.getGamepad();
    if (this.data.enabled && gamepad) {

      // Fire DOM events for button state changes.
      for (var i = 0; i < gamepad.buttons.length; i++) {
        if (gamepad.buttons[i].pressed && !this.buttons[i]) {
          this.emit(new GamepadButtonEvent('gamepadbuttondown', i, gamepad.buttons[i]));
        } else if (!gamepad.buttons[i].pressed && this.buttons[i]) {
          this.emit(new GamepadButtonEvent('gamepadbuttonup', i, gamepad.buttons[i]));
        }
        this.buttons[i] = gamepad.buttons[i].pressed;
      }

    } else if (Object.keys(this.buttons)) {
      // Reset state if controls are disabled or controller is lost.
      this.buttons = {};
    }
  }
275598
def games_for_date(year, month, day)
      games_page = GamedayFetcher.fetch_games_page(year, month, day)
      gids = find_gid_for_date(year, month, day, games_page)
      if gids
        results = gids.collect {|gid| Game.new(gid) }
      else 
        results = nil
      end
      results
    end
425760
def DbGetDeviceFamilyList(self, argin):
        
        self._log.debug("In DbGetDeviceFamilyList()")
        argin = replace_wildcard(argin)
        return self.db.get_device_family_list(argin)
967493
@Field(1)
	protected DeviceList devices(Pointer<Pointer<Device>> devices) {
		this.io.setPointerField(this, 1, devices);
		return this;
	}
245814
protected function getDevices() {
        if (!$this->_devices) {
            $this->_devices = new DeviceList($this->version, $this->solution['sid']);
        }

        return $this->_devices;
    }
1236619
function DetectGamingHandheld()
   {
      if ((stripos($this->useragent, $this->devicePlaystation) > -1) &&
         (stripos($this->useragent, $this->devicePlaystationVita) > -1))
         return $this->true; 
      else
         return $this->false; 
   }
244010
public void situateDevice(Device d, double x, double y) {
        devices.setObjectLocation(d, new Double2D(x, y));
    }
946209
public function getDeviceCategory()
    {
        $period = $this->analyticsDuration();

        $data = Analytics::performQuery($period, 'ga:sessions', [
            'dimensions' => 'ga:deviceCategory'
        ]);

        $items = [];
        foreach ($data->rows as $k => $item) {
            $items[] = $this->getPieDataSet(ucfirst($item[0]), $item[1]);
        }

        return $items;
    }
1211774
function items(items, channel) {
    items.forEach(function (item) {
        let item_values = [];
        item_values.push({_attr: {'turbo': 'true'}});
        item_values.push({link: item.url});

        ifTruePush(item.turboSource, item_values, {'turbo:source': item.turboSource});
        ifTruePush(item.turboTopic, item_values, {'turbo:topic': item.turboTopic});
        ifTruePush(item.date, item_values, {pubDate: new Date(item.date).toUTCString()});
        ifTruePush(item.author, item_values, {author: item.author});

        let img = '';
        let menu = '';

        if (item.image_url) {
            img = '<figure><img src="' + item.image_url + '" /></figure>';
        }

        if (Array.isArray(item.menu)) {
            menu = '<menu>' + item.menu.map(function (item) {
                return '<a href="' + item.link + '">' + item.text + '</a>';
            }).join('') + '</menu>';
        }

        let fullContent = '<header>' + img + ' <h1>' + item.title + '</h1>' + menu + '</header>' + item.content;

        item_values.push({'turbo:content': {_cdata: fullContent}});

        if (typeof item.related !== 'undefined') {
            addRelated(item.related, item_values, item.relatedfinity);
        }

        channel.push({item: item_values});
    });
}
346298
function () {
    var data = this.data;
    var controllerIndex = data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2;
    checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {index: controllerIndex});
  }
968055
def get_device_category(self, cat):
        """"""
        if cat in self.device_categories:
            return self.device_categories[cat]
        else:
            return False
264255
function () {
        var gamepads = navigator.getGamepads();
        var e = {};

        // Trigger button bindings
        Object.keys(bindings).forEach(function (index) {
            var gamepad = gamepads[index];
            if (!gamepad) {
                return;
            }

            var mapping = null;
            if (gamepad.mapping !== "standard") {
                mapping = remap.get(gamepad.id);
            }

            var binding = bindings[index];

            // Iterate all buttons that have active bindings
            Object.keys(binding.buttons).forEach(function (button) {
                var last = binding.buttons[button];
                var mapped_button = button;
                var mapped_axis = -1;

                // Remap buttons if necessary
                if (mapping) {
                    mapped_button = mapping.buttons[button];
                    mapped_axis = mapping.analog[button];
                    if (mapped_button < 0 && mapped_axis < 0) {
                        // Button is not mapped
                        return;
                    }
                }

                // Get mapped button
                var current = gamepad.buttons[mapped_button] || {};

                // Remap an axis to an analog button
                if (mapping) {
                    if (mapped_axis >= 0) {
                        var value = mapping.normalize_fn(gamepad.axes[mapped_axis], -1, +button);

                        // Create a new object, because GamepadButton is read-only
                        current = {
                            "value" : value,
                            "pressed" : current.pressed || (Math.abs(value) >= deadzone)
                        };
                    }
                }

                me.event.publish(me.event.GAMEPAD_UPDATE, [ index, "buttons", +button, current ]);

                // Edge detection
                if (!last.pressed && current.pressed) {
                    api._keydown(e, last.keyCode, mapped_button + 256);
                }
                else if (last.pressed && !current.pressed) {
                    api._keyup(e, last.keyCode, mapped_button + 256);
                }

                // Update last button state
                last.value = current.value;
                last.pressed = current.pressed;
            });

            // Iterate all axes that have active bindings
            Object.keys(binding.axes).forEach(function (axis) {
                var last = binding.axes[axis];
                var mapped_axis = axis;

                // Remap buttons if necessary
                if (mapping) {
                    mapped_axis = mapping.axes[axis];
                    if (mapped_axis < 0) {
                        // axe is not mapped
                        return;
                    }
                }

                // retrieve the current value and normalize if necessary
                var value = gamepad.axes[mapped_axis];
                if (typeof(value) === "undefined") {
                    return;
                }
                if (mapping) {
                    value = mapping.normalize_fn(value, +axis, -1);
                }
                // normalize value into a [-1, 1] range value (treat 0 as positive)
                var range = Math.sign(value) || 1;
                if (last[range].keyCode === 0) {
                    return;
                }
                var pressed = (Math.abs(value) >= (deadzone + Math.abs(last[range].threshold)));

                me.event.publish(me.event.GAMEPAD_UPDATE, [ index, "axes", +axis, value ]);

                // Edge detection
                if (!last[range].pressed && pressed) {
                    // Release the opposite direction, if necessary
                    if (last[-range].pressed) {
                        api._keyup(e, last[-range].keyCode, mapped_axis + 256);
                        last[-range].value = 0;
                        last[-range].pressed = false;
                    }

                    api._keydown(e, last[range].keyCode, mapped_axis + 256);
                }
                else if ((last[range].pressed || last[-range].pressed) && !pressed) {
                    range = last[range].pressed ? range : -range;
                    api._keyup(e, last[range].keyCode, mapped_axis + 256);
                }

                // Update last axis state
                last[range].value = value;
                last[range].pressed = pressed;
            });
        });
    }
981190
def ListDevices(self):
    '''
    '''
    devices = []

    for obj in mockobject.objects.keys():
        if obj.startswith('/org/bluez/') and 'dev_' in obj:
            devices.append(dbus.ObjectPath(obj, variant_level=1))

    return dbus.Array(devices, variant_level=1)