Advertisement
Guest User

Untitled

a guest
May 11th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.77 KB | None | 0 0
  1. #kingsvalley 2 overlay proof of concept
  2.  
  3.  eval kv_overlay {
  4.  
  5.     proc activate_kv2_editor {} {
  6.         osd_widgets::msx_init kv
  7.         bind -layer kv "mouse button1 down" {puts "click"}
  8.         FollowMouse
  9.     }
  10.  
  11.     proc FollowMouse {} {
  12.         osd_widgets::msx_update kv
  13.        
  14.        
  15.         lassign [osd info "kv" -mousecoord] x y
  16.         #make sure you register only on the MSX screen
  17.         if ($x<0) {set x 0}
  18.         if ($y<0) {set y 0}
  19.         if ($x=="Inf") {set x 0}
  20.         if ($y=="Inf") {set y 0}
  21.  
  22.         poke 0xe265  [expr {int($x / 8)}]
  23.         poke 0xe264  [expr {int($y / 8)}]
  24.  
  25.         bind -layer kv "mouse button1 down" {puts "click"}
  26.  
  27.         after frame kv_overlay::FollowMouse
  28.     }
  29.     #
  30.     #bind -layer kv2_editor "mouse button1 down" {
  31.     #   puts "click"
  32.     #}
  33.  
  34. namespace export activate_kv2_editor
  35. }
  36.  
  37.  
  38.  
  39. namespace import kv_overlay::*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement