вы можете добавить eventListenr к каждому входу, а затем обрабатывать сфокусированный элемент. измените элемент черного ящика на div и задайте нужные свойства.
document.querySelectorAll(
var nodes_input=document.querySelectorAll(".row input");
for(let i=0;i<nodes_input.length;i++){
nodes_input[i].addEventListener("keyup", ()=>{switch_next(event,i)});
}
function switch_next(ev,i){
let k=ev.which,n=false;
if(k>64&&k<91){
n=Math.min(nodes_input.length-1,++i);
ev.target.value=ev.key;
}else{
ev.target.value="";
if(k==8){
n=Math.max(0,--i);
}else{
}
}
if(n!==false){
nodes_input[n].focus();
}
}
.row {
display: flex;
margin-left: 1.2em;
}
input[type="text"],.black-box {
width: 1em;
height: 1em;
font: 700 2em Chiller;
text-align: center;
vertical-align: middle;
padding: 1px;
margin: -1px;
text-transform: capitalize;
border: 2px solid black;
}
.black-box{
background-color:black;
}
<div class="row">
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
<div type="text" maxlength="0" autocomplete="off" class="black-box"></div>
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
</div>
)