我正在使用zbarcam從我的webapps中的網絡攝像頭讀取條形碼。 但是,由於zbarcam在最後顯示\ n,我的表單被提交。使用xvkbd讀取條形碼。如何禁用Enter鍵?
下面是我用:
read_one.py
#!/usr/bin/python
from sys import argv
import zbar
import webbrowser
# create a Processor
proc = zbar.Processor()
# configure the Processor
proc.parse_config('enable')
# initialize the Processor
device = '/dev/video0'
if len(argv) > 1:
device = argv[1]
proc.init(device)
# enable the preview window
proc.visible = True
# read at least one barcode (or until window closed)
proc.process_one()
# hide the preview window
proc.visible = False
# extract results
for symbol in proc.results:
# do something useful with results
print symbol.data
keyboard.sh
python read_one.py | xvkbd -file -
如何,我不是在發送前刪除 '\ n'條碼到xvkbd或禁用xvkbd中的回車鍵?
完美,謝謝。 – Natim 2009-12-04 02:17:37