2023年06月18日 mplayerでdvd-videoをメニュー再生およびマウス操作する方法 [長年日記]
mplayer -mouse-movements dvdnav:// -dvd-device /dev/dvd1
_ キーボードでの操作方法
keypad 8 Select button up. keypad 2 Select button down. keypad 4 Select button left. keypad 6 Select button right. keypad 5 Return to main menu. keypad 7 Return to nearest menu (the order of preference is: chapter->title->root). keypad ENTER Confirm choice. (The following keys are used for controlling TV teletext. The data may come from either an analog TV source or an MPEG transport stream.) X Switch teletext on/off. Q and W Go to next/prev teletext page.
_ powershellでPUA、サロゲートペア、IVSを含んだ文字列を操作するサンプル
StringSample.ps1
function getLength($string){ $count = 0 for ($i = 0; $i -lt $s.length; $i++){ if ([int][char]$s[$i] -ge 0xd800 -and [int][char]$s[$i] -le 0xdbff){ if ([int][char]$s[$i] -eq 0xdb40){ # IVS H }else{ # SURR H $count++ } }elseif ([int][char]$s[$i] -ge 0xdc00 -and [int][char]$s[$i] -le 0xdfff){ if ([int][char]$s[$i] -ge 0xdd00 -and [int][char]$s[$i] -le 0xddef){ # IVS L }else{ # SURR L } }else{ # BMP $count++ } } return $count } function getCharByIndex($string, $index){ $out = "" $windex = -1 for ($i = 0; $i -lt $s.length; $i++){ if ([int][char]$s[$i] -ge 0xd800 -and [int][char]$s[$i] -le 0xdbff){ if ([int][char]$s[$i] -eq 0xdb40){ # IVS H }else{ # SURR H $windex++ } }elseif ([int][char]$s[$i] -ge 0xdc00 -and [int][char]$s[$i] -le 0xdfff){ if ([int][char]$s[$i] -ge 0xdd00 -and [int][char]$s[$i] -le 0xddef){ # IVS L }else{ # SURR L } }else{ # BMP $windex++ } if ($windex -eq $index){ $out = $s[$i] if ([int][char]$s[$i] -ge 0xd800 -and [int][char]$s[$i] -le 0xdbff){ if ([int][char]$s[$i] -eq 0xdb40){ # IVS H }else{ # SURR H $i++ $out += $s[$i] # add SURR L } } if ([int][char]$s[$i + 1] -eq 0xdb40){ # IVS H $i++ $out += $s[$i] # add IVS H $i++ $out += $s[$i] # add IVS L } } } return $out } function getSubString($string, $index, $length){ $out = "" for ($i = $index; $i -lt ($index + $length); $i++){ $out += (getCharByIndex $string $i) } return $out } $s = "a漢𠮷辻󠄀b" echo ("文字列:" + $s) echo ("文字数:" + (getLength $s)) echo ("0文字目:" + (getCharByIndex $s 0)) echo ("1文字目(BMP):" + (getCharByIndex $s 1)) echo ("2文字目(PUA):" + (getCharByIndex $s 2)) echo ("3文字目(surrogate):" + (getCharByIndex $s 3)) echo ("4文字目(BMP+IVS):" + (getCharByIndex $s 4)) echo ("2文字目から3文字分:" + (getSubString $s 2 3))
実行結果
PS C:\Users\USER\Desktop\PowerShell> .\SampleString.ps1 文字列:a漢𠮷辻󠄀b 文字数:6 0文字目:a 1文字目(BMP):漢 2文字目(PUA): 3文字目(surrogate):𠮷 4文字目(BMP+IVS):辻󠄀 2文字目から3文字分:𠮷辻󠄀 PS C:\Users\USER\Desktop\PowerShell>