Skip to content

Instantly share code, notes, and snippets.

@lab1092
Last active December 13, 2015 22:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lab1092/4985090 to your computer and use it in GitHub Desktop.
Save lab1092/4985090 to your computer and use it in GitHub Desktop.
Blenderのキーボードショートカットを表示させようかなと思ってみたのじゃが…
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
<!--
#tbl span{
display: inline-block;
}
#tbl .knone{
padding: 2px 4px;
}
#tbl .key{
border:solid 1px black;
border-radius:5px;
margin: 1px;
padding: 2px 2px;
height: 30px;
background-color: rgb(230, 230, 230);
background: -moz-linear-gradient(50% 0%, rgb(255, 255, 255), rgb(230, 230, 230));
background: -webkit-gradient(linear, left top , left bottom , from(rgb(255, 255, 255)), color-stop(50%, rgb(255, 255, 255)), to(rgb(230, 230, 230)));
font-size: 14px;
}
#mb span{
display: inline-block;
}
#mb .knone{
padding: 2px 4px;
}
#mb .key{
border:solid 1px black;
border-radius:5px;
margin: 1px;
padding: 2px 2px;
height: 30px;
background-color: rgb(230, 230, 230);
background: -moz-linear-gradient(50% 0%, rgb(255, 255, 255), rgb(230, 230, 230));
background: -webkit-gradient(linear, left top , left bottom , from(rgb(255, 255, 255)), color-stop(50%, rgb(255, 255, 255)), to(rgb(230, 230, 230)));
font-size: 12px;
}
.board {
margin: 0.5em 6px;
border: 1px solid rgb(200, 200, 200);
background: none repeat scroll 0% 0% #DDDDDD;
color: rgb(0, 0, 0);
border-radius: 7px 7px 7px 7px;
padding: 7px 7px;
text-decoration: none;
}
.note {
margin: 0.5em 6px;
border: 1px solid rgb(200, 220, 200);
background-color: #F0FFF0;
color: rgb(0, 0, 0);
border-radius: 7px 7px 7px 7px;
padding: 3px 7px;
text-decoration: none;
}
#tbl .width1 { width : 16px;}
#tbl .width2 { width : 32px;}
#tbl .width3 { width : 51px;}
#tbl .width4 { width : 74px;}
#tbl .width5 { width : 84px;}
#mb .width2 { width : 32px;}
#txt1 { font-size: 18px; }
-->
</style>
<script>
// キーマップ
// * キーマップは 大きく 3つの構成とします。
// * キーではない箇所は ["",<width>] の形で、
// キーの箇所は[<キーラベル>,<width>,<キーコード>] の形で記載します。
//
// キー定義リスト
// * モードごとに分類。
// "*"は全て共通
// OBject/EDit/SCrupt/VErtexpaint/TExturepaint/Weightpaint
// * { <モード指定子> : <ノート> } の形。
// * "[1]レイヤー1を選択/(Shtft+)レイヤー1を追加選択..."
var kmap = [
[
[["Esc",2,27],["",1],["F1",2,112],["F2",2,113],["F3",2,114],["F4",2,115],["",1],["F5",2,116,],["F6",2,117],["F7",2,118],["F8",2,119],["",1],["F9",2,120],["F10",2,121],["F11",2,122],["F12",2,123],["",1]],
[["全角",2,229],["1",2,49],["2",2,50],["3",2,51],["4",2,52],["5",2,53],["6",2,54],["7",2,55],["8",2,56],["9",2,57],["0",2,48],["-",2,189],["^",2,222],["\\",2,220],["BS",2,8]],
[["Tab",3,9],["Q",2,81],["W",2,87],["E",2,69],["R",2,82],["T",2,84],["Y",2,89],["U",2,85],["I",2,73],["O",2,79],["P",2,80],["@",2,192],["[",2,219],["Enter",3,13]],
[["Caps Lock",4,240],["A",2,65],["S",2,83],["D",2,68],["F",2,70],["G",2,71],["H",2,72],["J",2,74],["K",2,75],["L",2,76],[";",2,187],[":",2,186],["]",2,221],["",2]],
[["Shift",5,16],["Z",2,90],["X",2,88],["C",2,67],["V",2,86],["B",2,66],["N",2,78],["M",2,77],[",",2,188],[".",2,190],["/",2,191],["\\",2,226],["Shift",3,16]],
[["Ctrl",4,17],["Win",2,91],["Alt",2,18],["無変換",4,29],["Space",4,32],["変換",3,229],["ひら",3,242],["Alt",2,18],["Win",2,92],["App",2,93],["Ctrl",2,17]]
],
[
[["Print",2,44],["Slock",2,145],["Pause",2,19]],
[["Insert",2,45],["Home",2,36],["PgUp",2,33]],
[["Delete",2,46],["End",2,35],["PgDn",2,34]],
[["",2],["",2],["",2]],
[["",2],["↑",2,38],["",2]],
[["←",2,37],["↓",2,40],["→",2,39]]
],
[
[["",2],["",2],["",2],["",2]],
[["Num",2,144],["/",2,111],["*",2,106],["-",2,109]],
[["7",2,103],["8",2,104],["9",2,105],["+",2,107]],
[["4",2,100],["5",2,101],["6",2,102],["",2]],
[["1",2,97],["2",2,98],["3",2,99],["Ent",2,13]],
[["0",4,96],[".",2,110],["",2]]
],
[
[["",2],["WhUp",2,1004],["",2]],
[["LMB",2,1001],["MMB",2,1002],["RMB",2,1003]],
[["",2],["WhDn",2,1005],["",2]]
]
];
var clist = ["tbl1","tbl2","tbl3","tbl4"];
// ココから下を頑張って書いてください!!
var bindlist={
1001:{ "*" : "[左ボタン]確定"},
1002:{ "*" : "[中ボタン]スクロール"},
1003:{ "*" : "[右ボタン]キャンセル/選択"},
1004:{ "*" : "[ホイール上]拡大"},
1005:{ "*" : "[ホイール下]縮小"},
27:{ "*" : "[Esc]キャンセル"},
112:{ "ob" : "[F1]" },
113:{ "ob" : "[F2]" },
114:{ "ob" : "[F3]" },
115:{ "ob" : "[F4]" },
116:{ "ob" : "[F5]" },
117:{ "ob" : "[F6]" },
118:{ "ob" : "[F7]" },
119:{ "ob" : "[F8]" },
120:{ "ob" : "[F9]" },
121:{ "ob" : "[F10]" },
122:{ "ob" : "[F11]" },
123:{ "ob" : "[F12]" },
229:{ "ob" : "[Esc]" },
49:{ "ob" : "[1]" },
50:{ "ob" : "[2]" },
51:{ "ob" : "[3]" },
52:{ "ob" : "[4]" },
53:{ "ob" : "[5]" },
54:{ "ob" : "[6]" },
55:{ "ob" : "[7]" },
56:{ "ob" : "[8]" },
57:{ "ob" : "[9]" },
48:{ "ob" : "[0]" },
189:{ "ob" : "[-]" },
222:{ "ob" : "[^]" },
220:{ "ob" : "[\\]" },
8:{ "ob" : "[BackSpace]" },
9:{ "ob" : "[Tab]エディットモードへ",
"ed" : "[Tab]オブジェクトモードへ"
},
81:{ "ob" : "[Q]" },
87:{ "ob" : "[W]" },
69:{ "ob" : "[E]" },
82:{ "ob" : "[R]" },
84:{ "ob" : "[T]" },
89:{ "ob" : "[Y]" },
85:{ "ob" : "[U]" },
73:{ "ob" : "[I]" },
79:{ "ob" : "[O]" },
80:{ "ob" : "[P]" },
192:{ "ob" : "[@]" },
219:{ "ob" : "[[]" },
13:{ "*" : "[Enter]確定"},
240:{ "ob" : "[CapasLock" },
65:{ "ob" : "[A]" },
83:{ "ob" : "[S]" },
68:{ "ob" : "[D]" },
70:{ "ob" : "[F]" },
71:{ "ob" : "[G]" },
72:{ "ob" : "[H]" },
74:{ "ob" : "[J]" },
75:{ "ob" : "[K]" },
76:{ "ob" : "[L]" },
187:{ "ob" : "[;]" },
186:{ "ob" : "[:]" },
221:{ "ob" : "[]]" },
16:{ "ob" : "[Shift]" },
90:{ "ob" : "[Z]" },
88:{ "ob" : "[X]" },
67:{ "ob" : "[C]" },
86:{ "ob" : "[V]" },
66:{ "ob" : "[B]" },
78:{ "ob" : "[N]" },
77:{ "ob" : "[M]" },
188:{ "ob" : "[,]" },
190:{ "ob" : "[.]" },
191:{ "ob" : "[/]" },
226:{ "ob" : "[\]" },
17:{ "ob" : "[Ctrl]" },
91:{ "ob" : "[Windows]" },
18:{ "ob" : "[Alt]" },
29:{ "ob" : "[無変換]" },
32:{ "ob" : "[Space]" },
229:{ "ob" : "[変換]" },
242:{ "ob" : "[カタカナひらがな]" },
92:{ "ob" : "[Windows]" },
93:{ "ob" : "[AppMenu]" },
44:{ "ob" : "[PrintScreen]" },
145:{ "ob" : "[ScrollLock]" },
19:{ "ob" : "[Pause]" },
45:{ "ob" : "[Insert]" },
36:{ "ob" : "[Home]" },
33:{ "ob" : "[PageUp]" },
46:{ "ob" : "[Delete]" },
35:{ "ob" : "[End]" },
34:{ "ob" : "[PageDown]" },
38:{ "ob" : "[↑]" },
37:{ "ob" : "[←]" },
40:{ "ob" : "[↓]" },
39:{ "ob" : "[→]" },
144:{ "ob" : "[NumLock]" },
111:{ "ob" : "[テンキー/]" },
106:{ "ob" : "[テンキー*]" },
109:{ "ob" : "[テンキー-]" },
103:{ "ob" : "[テンキー7]" },
104:{ "ob" : "[テンキー8]" },
105:{ "ob" : "[テンキー9]" },
107:{ "ob" : "[テンキー+]" },
100:{ "ob" : "[テンキー4]" },
101:{ "ob" : "[テンキー5]" },
102:{ "ob" : "[テンキー6]" },
97:{ "ob" : "[テンキー1]" },
98:{ "ob" : "[テンキー2]" },
99:{ "ob" : "[テンキー3]" },
13:{ "ob" : "[テンキーEnter]" },
96:{ "ob" : "[テンキー0]" },
110:{ "ob" : "[テンキー.]" }
};
///
function htmlEscape(s){
s=s.replace(/&/g,'&amp;');
s=s.replace(/>/g,'&gt;');
s=s.replace(/</g,'&lt;');
return s;
}
function ctxt(note){
var txt = "定義の登録がありません(他のモードには存在する可能性があります)";
var mode = "";
var mtxt = "";
if( note['*'] != "" && note['*'] != undefined) {
txt = note['*'];
}
mode = document.getElementById("mode").value;
mtxt = note[mode];
if( mtxt != "" && mtxt != undefined ) {
txt = mtxt;
}
return txt;
}
function c( num ){
var note = "";
if( num != "" ) {
note = bindlist[parseInt(num)];
}
if( note != undefined ) {
document.getElementById("txt1").value= ctxt(note);
}else{
document.getElementById("txt1").value= "(キーコード["+num+"]:定義がありません)";
}
}
function a(){
var s = "";
var wc = "";
var c = 0;
for (var k = 0; k < clist.length; k++ ) {
s = "";
wc = "";
for (var j = 0; j < kmap[k].length; j ++) {
var kmapc = kmap[k][j];
for( var i=0; i < kmapc.length; i ++ ){
wc = "knone ";
if( kmapc[i][0] != ""){
wc = "key ";
}
if( kmapc[i][1] > 0){
wc = wc + "width"+kmapc[i][1].toString();
}
s = s + "<span"
if( kmap[k][j][i].length == 3 ) {
var obj = kmap[k][j][i][2]
if( obj != undefined ){
s= s+ " onclick=\"c('" + kmap[k][j][i][2].toString() + "');\"";
}
}
s = s + " class=\"" + wc +"\" title=\"" + htmlEscape(kmap[k][j][i][0]);
if( kmap[k][j][i].length == 3 ) {
s= s+ "(" + kmap[k][j][i][2].toString() + ")";
}
s = s + "\" >"+ htmlEscape(kmap[k][j][i][0]);
if( kmap[k][j][i].length == 3 && false) {
s= s+ "<br>(" + kmap[k][j][i][2].toString() + ")";
}
s = s + "</span>";
}
s= s+"<br>";
}
document.getElementById(clist[k]).innerHTML = "<div>"+s+"</div>";
}
}
</script>
</head>
<body onload="a();">
<div style="width:960px;">
<div class="note">
<table>
<tr>
<td style="width:700">
<h1>Blenderキーボードノート</h1>
モードを選んでください &gt;
<select id="mode">
<option value="ob">Object Mode</option>
<option value="ed">Edit Mode</option>
<option value="sc">Scrupt Mode</option>
<option value="ve">Vertex Paint</option>
<option value="te">Texture Paint</option>
<option value="we">Weight Paint</option>
</select>
</div>
</td>
<td>
<div id="mb" class="board">
<div id="tbl4" ></div>
</div>
</td>
</tr>
</table>
</div>
<div class="board">
<table id="tbl">
<tr>
<td><div id="tbl1" ></div></td>
<td><div id="tbl2" ></div></td>
<td><div id="tbl3" ></div></td>
</tr>
</table>
</div>
<div class="note">
対応バージョン: 2.65a (とか言ってますがまだいろいろ実装してませんからね)<br>
<textarea id="txt1" style="width:900px" rows="5" readonly="readonly" scroll="yes">(テキスト)</textarea>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment