I got a basic inventory toggle working with AutoHotkey using this script.
$i::
n:=!n ; invert or reverse the prior value, 1 or 0 are the only choices
if n=1
send {i}
else
send {enter}
return
Press "i" once to open the inventory, again to send an "enter" to close it.
It's not perfect, if you open a container with a right click, then you still need to hit enter, or escape, or press i twice.
For ground looting, or swapping equipment about though it works fine.