PS3 controller on Windows 8.1 via bluetooth

A PS3 Sixaxis controller can be used as an input device on Windows 8.1.

For this to work the free Motion In Joy (MiJ) application needs to be installed: http://www.motioninjoy.com/download. At the time of writing, for Windows 8.1 x64, select v0.7.1000 (testing).

Using the controller via a wired USB connection almost always works, but using a wireless Bluetooth connection can be a problem.

Possible error: "Wait for bluetooth adabter to be connected" (Yes, there is a typo in adabter)

The causes for this are:
  1. MiJ installs its own non-signed bluetooth driver, which is not allowed on Windows 8 unless the system is started with "driver signature enforcement" disabled
  2. The bluetooth device's hardware id is not in the INF file of the MiJ bluetooth driver
The following instructions are from WingedT on:
http://forums.motioninjoy.com/viewtopic.php?f=15&t=3764&start=10

I revised them and put them on my blog in case that post is deleted from the Motion In Joy forum.

Instructions for bluetooth support:
  1. Before starting, make sure bluetooth works by clicking the Bluetooth icon in the tray in right-bottom corner and selecting "Show bluetooth devices". If there are none, try "Add a bluetooth device" and try to pair e.g. a mobile phone. If this works, continue
  2. Install and start MiJ's DS3 Tool
  3. Select "Driver Manager" and click "install all"
    It might be that MiJ drivers for both devices (USB and bluetooth) are installed correctly. In that case they both have a green checkmark at the end in the MotionInJoy column. If one has a red cross, then most probably that is the bluetooth driver and that has not been installed
  4. Take the Hardware ID of that device and strip the revision part, i.e. for a Lenovo Y510P this might be that USB\VID_8087&PID_07DA&REV_7869 becomes USB\VID_8087&PID_07DA
  5. Open C:\Program Files\MotioninJoy\ds3\drivers\MijXinput.inf in a text editor. 
    1. Find and replace:
      ;BLUETOOTH DONGLE
      with
      ;BLUETOOTH DONGLE
      %MIJ.DeviceName%=CC_Install, USB\VID_8087&PID_07DA
    2. Delete the following line:
      catalog=MijXinput.cat
    3. Save and exit
  6. Restart Windows 8 with Advanced Options so Driver Signature Enforcement can be disabled. Open a command prompt (Win + X, command prompt) and type:
    shutdown /r o
  7. In the Advanced Options screen, select Advanced Options -> Windows Startup Settings -> Restart
  8. In the next screen with the Advanced Option to enable, choose: 7. Disable Driver Signature Enforcement. A reboot will follow
  9. Select "Driver Manager" and click "install all". Now both devices should have a green check mark:

  10. Exit and restart DS3 tool and once again click "Load driver". Now the bluetooth driver should be selectable in the BluetoothPair tab:

Reporting Services dynamic multi-column parameter box

The Reporting Services parameter section at the top of a report is generated as a HTML table with two fixed columns. To display SSRS parameters in three columns in the parameter field is not possible using a configuration option or even a CSS style sheet, so element conversion is needed.

The instructions below fixes this for the /reports and /reportserver web entry points and are suited for Reporting Services 2012, but might work for earlier versions as well.

The code:
  • Adds the jquery library to every report
  • Uses this library to:
    • Create a DIV element for each set of TD parameter elements (=label and textbox/dropdown) and add it to the first TD element of the first TR row
    • Add all sets of TD parameters to these DIVs
    • Remove all other TR rows from the parameter TABLE
The result is that as many parameters as possible are fitted on one horizontal row:


The code has to be appended to the end of the ReportingServices.js file. This file is added automatically to every report generated by Reporting Services.

The file is most probably located in the public javascript folder: c:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportManager\js

Perform the following steps to get a multiple columns in the parameter box:

1) Download and add the publicly available jquery-1.4.4.min.js to the public javascript folder.

2) Code to append:
// helper function to add scripts to head of html
function addHeadElement(headtype, file) {
var head = document.getElementsByTagName('head')[0];
  if (headtype == 'script')
  {
    var script = document.createElement('script');
    script.setAttribute('type', 'text/javascript');
    script.setAttribute('src', file);
    head.appendChild(script); 
  }
}
addHeadElement('script','/Reports/js/jquery-1.4.4.min.js');

// function that converts the parameter table to divs 
function param() {

  // create as many div->table->tr elements in the first column of the first row as there are parameters
  $(".ParamLabelCell").each( function (i, v) {
    var html = "<div style='float: left; padding-right: 10px;'> \
      <table> \
        <tr id='blackninja" + i + "'></tr> \
      </table> \
    </div>";
    $("td.InterParamPadding").filter(":first").append(html);
  });
  
  // move each label to its proper div->table->tr element
  $("td.ParamLabelCell").each( function (i, v) {
    $(this).appendTo("#blackninja" + i);
  });
  
  // move each prompt to its proper div->table->tr element
  $("td.ParamEntryCell").each( function (i, v) {
    $(this).appendTo("#blackninja" + i);
  });
  
  // remove all other parameter rows
  $("tr[isparameterrow='true']").not(':first').remove();

}
// add the convert function to the onload event twice
// this guarantees a cross-browser safe implementation
function pageLoad() {
  param();
}
window[ addEventListener ? 'addEventListener' : 'attachEvent' ]( addEventListener ? 'load' : 'onload', param );
3) Change style sheet

Add the following code to the styles\ReportingServices.css style sheet to make the dropdown boxes and textboxes smaller in width. More parameters will fit on a row:
.ParametersFrame.ParamsGrid.MenuBarBkGnd { padding: 0px; }
.DisabledTextBox { width: 125px; }
td.ParamEntryCell [id$="Value"] { width: 125px; }
td.ParamEntryCell { padding: 0px; }
td.SubmitButtonCell { padding-top: 2px; padding-bottom: 0px; }
td.ParamLabelCell { padding-right: 5px; }
td.InterParamPadding { padding-left: 0px; }
/* IE11 Edge/default profile fix */
tr.MenuBarBkGnd { height: 0px; } 
#ParametersRowctl31 { height: 0px; }
4) Enable in the reportserver

Add the following two elements to the head-element in \ReportServer\Pages\ReportViewer.aspx:
<meta http-equiv="X-UA-Compatible" content="IE=9">
<link href="/Reports/styles/ReportingServices.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="/Reports/js/ReportingServices.js"></script>
<script type="text/javascript" src="/Reports/js/jquery-1.4.4.min.js"></script>

Reinstall OEM-installed Windows 8.1

One of the first steps of the re-installation process of Windows 8.1 is that it asks for a Windows key. There is a "bug" that prevents a valid Windows key from working when the general Windows 8 installation disk is used on a laptop with a pre-installed OEM version.

Fortunately, if there are no installation disks supplied, then Windows 8.1 can still be easily re-installed on such a laptop, for example on another partition or disk:

1. Get a copy of the Windows 8.1 ISO, e.g. "Windows_8.1_EN-US_x64.ISO" and extract the contents to a USB stick

2. Bypass the Windows key screen by creating an ei.cfg text file in the sources folder on the USB stick. It should contain the following (replace "Core" with "Professional", if you have a valid key for that edition):

[EditionID]
Core
[Channel]
Retail
[VL]
0

3. Restart the laptop with the USB stick in it. The initial Windows key screen is skipped. During the latter part of the installation another Windows key screen pops up. Here the genuine valid key can be entered

Notes
  • It has to be a USB stick, an external disk will not work: Win 8 can only be installed from an USB stick or a DVD
  • Unfortunately, I cannot supply a link to the above mentioned ISO file
  • Make sure the BIOS settings are such that the USB stick can be booted from and is the first in the sequence of bootable devices. Check how to enter the BIOS and set the bootable USB device on the site of the laptop manufacturer. Each manufacturer has a different method. For Lenovo IdeaPad: press and hold the small round button next to the power adapter entrance during a reboot