update linker
This commit is contained in:
		
							
								
								
									
										2
									
								
								link.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										2
									
								
								link.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					ln -s src/bearlibterminal/libBearLibTerminal.so .
 | 
				
			||||||
							
								
								
									
										4
									
								
								readme.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								readme.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					develpoment
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					run linker.sh to create symlink, go library headers are already configured to use .so in same folder with binary
 | 
				
			||||||
@@ -22,9 +22,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
package bearlibterminal
 | 
					package bearlibterminal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// // #cgo LDFLAGS: -I/home/agurov/projects/zaar/alchemyst-go/src/bearlibterminal -L/home/agurov/projects/zaar/alchemyst-go/lib -lBearLibTerminal
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// // #cgo LDFLAGS: -L../../lib -lBearLibTerminal
 | 
					 | 
				
			||||||
// #cgo LDFLAGS: -L. -Wl,-rpath -Wl,./ -lBearLibTerminal
 | 
					// #cgo LDFLAGS: -L. -Wl,-rpath -Wl,./ -lBearLibTerminal
 | 
				
			||||||
// #include <stdlib.h>
 | 
					// #include <stdlib.h>
 | 
				
			||||||
// #include <BearLibTerminal.h>
 | 
					// #include <BearLibTerminal.h>
 | 
				
			||||||
@@ -34,7 +31,6 @@ import (
 | 
				
			|||||||
	"unsafe"
 | 
						"unsafe"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
// compile with go build -o test
 | 
					// compile with go build -o test
 | 
				
			||||||
// check relative path with objdump -p test | grep RPATH
 | 
					// check relative path with objdump -p test | grep RPATH
 | 
				
			||||||
// must be: RPATH                ./
 | 
					// must be: RPATH                ./
 | 
				
			||||||
@@ -43,7 +39,6 @@ import (
 | 
				
			|||||||
// when development is complete, just $ sudo rm /etc/ld.so.conf.d/libbearterminal.conf
 | 
					// when development is complete, just $ sudo rm /etc/ld.so.conf.d/libbearterminal.conf
 | 
				
			||||||
// compiled binaties must still work in same folder with .so
 | 
					// compiled binaties must still work in same folder with .so
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Keyboard scancodes for events/states
 | 
					// Keyboard scancodes for events/states
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,13 +19,13 @@ func ReadKey() (string, int)  {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        pressed = Scancodemap[key]
 | 
					        pressed = Scancodemap[key]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (blt.Check(blt.TK_SHIFT) != 0) {
 | 
					        if blt.Check(blt.TK_SHIFT) != 0 {
 | 
				
			||||||
            pressed = "Shift+" + pressed
 | 
					            pressed = "Shift+" + pressed
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (blt.Check(blt.TK_ALT) != 0) {
 | 
					        if blt.Check(blt.TK_ALT) != 0 {
 | 
				
			||||||
            pressed = "Alt+" + pressed
 | 
					            pressed = "Alt+" + pressed
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (blt.Check(blt.TK_CONTROL) != 0) {
 | 
					        if blt.Check(blt.TK_CONTROL) != 0 {
 | 
				
			||||||
            pressed = "Ctrl+" + pressed
 | 
					            pressed = "Ctrl+" + pressed
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        fmt.Println(pressed)
 | 
					        fmt.Println(pressed)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user