見出し画像

PowerShell PageUPとPageDownキーを無効化したい

HPのPavilion Aero 13-beの2023年版最上位モデル(Ryzen 7 7735U)を買いました。これが滅茶苦茶イイ!

・画面サイズ13.3インチでありながら重量は957g
・Ryzen 7 7735Uを搭載した強力な処理能力
・メモリ16GB、SSD512GB
・USB-TypeCで充電可能
・価格は10万円ほど
モバイルノートPCを探している方にお勧めです。

ひとつだけ欠点があって、キーボードの配列が独特なんです。
ENTERキーの右にPageUP、PageDownキーがあって間違って押しやすい構造になっています。


HP ProBook 430 G1も↑これと同じキーボードでした。

Enterキーを押そうとしてPageUP、PageDownキーを押してしまいます。

これをなんとかしたい

そうだ PowerShellを使おう!


次の操作を順におこなえば解決します。

1.スタートボタンを右クリックする。
2.ターミナル(管理者)またはWindows PowerShell(管理者)を左クリックします。
3.「このアプリがデバイスに変更を~~」と警告画面が表示されたら、「はい」をクリックします。
4.背景が黒いウインドウが表示される。
黒いウインドウに下のスクリプトを張り付けて、
「強制的に貼り付け」を選択、次にEnterキーを押す。
画面に「Scancode Map~」と表示されたら、再起動するとPageUP、PageDownキーが無効化されます。


「強制的に貼り付け」を選択、次にEnterキー


「Scancode Map~」と表示されたら、再起動



PageUP、PageDownキーを無効にするスクリプト

###レジストリ追加/更新
function RegSet( $RegPath, $RegKey, $RegKeyType, $RegKeyValue ){
  #レジストリそのものの有無確認
  $Elements = $RegPath -split "\\"
  $RegPath = ""
  $FirstLoop = $True
  foreach ($Element in $Elements ){
    if($FirstLoop){
      $FirstLoop = $False
    }else{
      $RegPath += "\"
    }
    $RegPath += $Element
    if( -not (test-path $RegPath) ){
      echo "Add Registry : $RegPath"
      md $RegPath
    }
  }
  #Key有無確認
  $Result = Get-ItemProperty $RegPath -name $RegKey -ErrorAction  SilentlyContinue #キーがあった時 
  if( $Result -ne $null ){
    Set-ItemProperty $RegPath -name $RegKey -Value $RegKeyValue 
  } else{
    #キーが無かった時 キーを追加する
    New-ItemProperty $RegPath -name $RegKey -PropertyType $RegKeyType -Value $RegKeyValue 
  } 
  Get-ItemProperty $RegPath -name $RegKey
}

$RegPath="HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout"
$RegKey="Scancode Map"
$RegKeyType = "Binary"
$RegKeyValue = @()
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x03
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x49
$RegKeyValue += [byte]0xE0
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x51
$RegKeyValue += [byte]0xE0
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
$RegKeyValue += [byte]0x00
RegSet $RegPath $RegKey $RegKeyType $RegKeyValue



アマゾンでは
2023年モデルが103,900円、2021年モデルが119,900円で併売されている。
今だけセールかもしれないので、手に入れるなら今!



#PowerShell #スクリプト #モバイルノートPC #Pavilion Aero 13-be #レジストリ


この記事が気に入ったらサポートをしてみませんか?