[hatari-devel] Re: kontakts

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hello,

please create a proper diff/patch file and submit it to the Hatari
development mailing list for review. Your binary upload is now very
helpful.

I personally don't think it is a good idea to hack something into the
current API functions. Atm configuration is only supposed to work with
the mapping table which is intended for later loading from disk.

Regards,
Matthias


Am Samstag, den 26.05.2012, 11:20 +0200 schrieb sheevastar: 
> Hello Mathias,
> 
> Now it fully works. I have into joy.c the following to make it work:
> 
> 
> /*-----------------------------------------------------------------------*/
> /**
>  * Read details from joystick using SDL calls
>  * NOTE ID is that of SDL
>  */
> static bool Joy_ReadJoystick(int nSdlJoyID, JOYREADING *pJoyReading)
> {
> 	/* Joystick is OK, read position */
> 	pJoyReading->XPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], 3);
> 	pJoyReading->YPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], 4);
> 	/* Sets bit #0 if button #1 is pressed: */
> 	pJoyReading->Buttons = SDL_JoystickGetButton(sdlJoystick[nSdlJoyID], 1);
> 	/* Sets bit #1 if button #2 is pressed: */
> 	if (SDL_JoystickGetButton(sdlJoystick[nSdlJoyID], 2))
> 		pJoyReading->Buttons |= JOY_BUTTON2;
> 
> 	return true;
> }
> 
> 
> this works very well. 
> 
> I would like to ask you, I would like QUIT hatari with pressing the key of the gamepad number 8 or 9 (without popup would you like to quit Y/N"), i.e.
> if (SDL_JoystickGetButton(sdlJoystick[nSdlJoyID], 8))
> would you know what should I add to joy.c ? 
> If would get at pressing of this SELECT (button 8) to x11 and quit hatari to my game selector.
> 
> 
> this following python search for files and associate it with its cover as jpg or png
> 
> for instance
> 
> mybackup.st
> mybackup.png
> 
> 
> will show you your owned st files and display the png of it
> 
> (There is a small bug wiht the first file of a list `ls -1`  not seen)
>  
> 
> 
> cd  my_ST_files
> python selector.py
> 
> #!/usr/bin/python
> 
> # ZetCode PyGTK tutorial 
> #
> # This example shows a TreeView widget
> # in a list view mode
> #
> # author: jan bodnar
> # website: zetcode.com 
> # last edited: February 2009
> 
> 
> import gtk
> import pango
> import sys
> 
> # I need os to play my sounds
> import os
> 
> #import pygtk
> #pygtk.require('2.0')
> #import gtk
> #import glib
> #import sys
> 
> 
> 
> quotes = """Excess of joy is harder to bear than any amount of sorrow.
> The more one judges, the less one loves.
> There is no such thing as a great talent without great will power. 
> """
> 
> 
> 
> 
> 
> def is_image(filename):
> 	""" File is image if it has a common suffix and it is a regular file """
> 	if not os.path.exists(filename):
> 		return False
> 
> 	for suffix in ['.png','.jpg']:
> 		if filename.lower().endswith(suffix):
> 			return False
> 
> 	return True
> 	
> 
> 
> 
> 
> def is_real_image(filename):
>     """ File is image if it has a common suffix and it is a regular file """
> 
>     if not os.path.isfile(filename):
>         return False
> 
>     for suffix in ['.png','.jpg']:
>         if filename.lower().endswith(suffix):
>             return True
>             # notice here the difference with def above
>             # it will get all the jpg and png
> 
>     return False
> 	
> 
> 
> class PyApp(gtk.Window): 
> 
>     SECONDS_BETWEEN_PICTURES = 3
>     FULLSCREEN = True
>     WALK_INSTEAD_LISTDIR = True
>     
>     
>     def __init__(self):
>         super(PyApp, self).__init__()
>         
>         
>         # here we have the list view
>         self.set_size_request(350, 250)
>         self.set_position(gtk.WIN_POS_CENTER)
>         
>         self.connect("destroy", gtk.main_quit)
>         self.set_title("ListView")
>         # here for key ctrl
>         self.connect('key_press_event', self.keypress)
>         
>         self.index = 0 
>         self.filenameselector=""
>         
>         self.load_file_list()
> 
>         vbox = gtk.VBox(False, 8)
>         
>         sw = gtk.ScrolledWindow()
>         sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
>         sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
>         
>         vbox.pack_start(sw, True, True, 0)
> 
>         store = self.create_model()
> 
>         self.treeView = gtk.TreeView(store)
>         self.treeView.connect("row-activated", self.on_activated)
> 
> 
> 
> 
>         selection = self.treeView.get_selection()
>         selection.set_mode(gtk.SELECTION_BROWSE) 
>         selection.connect('changed', self.selection_changed_cb) 
> 
>         
>         
>         self.treeView.set_rules_hint(True)
>         sw.add(self.treeView)
> 
>         self.create_columns(self.treeView)
>         self.statusbar = gtk.Statusbar()
>         
>         vbox.pack_start(self.statusbar, False, False, 0)
>         
> 
> 
> 
>         # here we have the text stuffs description
>         # it may need pango?
>         # fix is the txt
>         #self.connect("destroy", gtk.main_quit)
>         #self.set_title("Quotes")
>         #self.label = gtk.Label(quotes)
>         #self.fontdesc = pango.FontDescription("Purisa 10")
>         #self.label.modify_font(self.fontdesc)
>         self.fix = gtk.Fixed()
>         #self.fix.put(self.label, 5, 5)
>         #self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
>         self.fix = gtk.Label( "Hello menus")
>         
> 
>         # buttons are here	- buttons are vbox
>         # here the buttons
>         self.set_title("Buttons")
>         btn1 = gtk.Button("Set another name")
>         btn1.set_size_request(80, 30)
>         btn1.connect("clicked", self.on_button1_clicked)
> 		#btn1.set_sensitive(False)
> 		
>         btn2 = gtk.Button("Button2")
>         btn3 = gtk.Button(stock=gtk.STOCK_CLOSE)
>         btn4 = gtk.Button("Button4")
>         btn4.set_size_request(80, 40)
>         fixed = gtk.Fixed()
>         fixed.put(btn1, 20, 30)
>         fixed.put(btn2, 100, 30)
>         fixed.put(btn3, 20, 80)
>         fixed.put(btn4, 100, 80)
>         vbox.connect("destroy", gtk.main_quit)
>         #vbox.add(fixed)
> 
> 
> 
> 
> 		# old with three images
>         # images are here		
>         # it may need sys?
>         #try:
>             #self.bardejov = gtk.gdk.pixbuf_new_from_file("bardejov.jpg")
>             #self.rotunda = gtk.gdk.pixbuf_new_from_file("rotunda.jpg")
>             #self.mincol = gtk.gdk.pixbuf_new_from_file("mincol.jpg")
>         #except Exception, e:
>         #    print e.message
>         #    sys.exit(1)
>         #image1 = gtk.Image()
>         #image2 = gtk.Image()
>         #image3 = gtk.Image()
>         
>         #image1.set_from_pixbuf(self.bardejov)
>         #image2.set_from_pixbuf(self.rotunda)
>         #image3.set_from_pixbuf(self.mincol)
>         #fiximages = gtk.Fixed()
>         #fiximages.put(image1, 5, 5)
>         #fiximages.put(image2, 40, 160)
>         #fiximages.put(image3, 170, 50)
> 
> 
> 
> 		# new simple wiht canvas images
> 		#canvas.set_from_file("rotunda.jpg")
>         self.canvas = gtk.Image()
>         vbox.add(self.canvas)
>         self.canvas.show()
>         #self.canvas.set_from_file("bardejov.jpg")
>         
> 
> 
> 
>      # here we display all those stuffs
>         self.add(vbox)
>         #vbox.add(fiximages)
>         # this if you do not want buttons : keep it vbox.add(self.fix)
>         
>         self.fullscreen()
>         self.show_all()
> 
> 
> 
>         
>     def selection_changed_cb(self, selection):
>         model, iter = selection.get_selected()
>         if not iter:  # get_selected returns None when you click on the arrow 
>             return False
>         if model.iter_has_child(iter):
>             return True
> 
>         if not iter:
>             return False
> 
>         name = model.get_value(iter, 1)
>         print "Select: " + name
>         #self.load_module(name)
>         #self.l.sb("file: %s.py" % name) 
>         filetxt = name
>         self.statusbar.push(0, filetxt)
>         #self.canvas.set_from_file(filetxt)
>         self.fix.set_text(" Loading: "+filetxt )
>         self.filenameselector=filetxt
>         filenamefull = os.path.splitext(self.filenameselector)[0]
>         #filenamefull = filenamefulltmp.replace(".fvwmmacosxmplayerplaylistnbr", "")  
>         extension = os.path.splitext(self.filenameselector)[1]
>         filenamefullpng= filenamefull + ".png"
>         filenamefulljpg= filenamefull + ".jpg"
>         oshome = os.environ['HOME']
>         testifisfilejpg = os.path.isfile(filenamefulljpg)
>         testifisfile = os.path.isfile(filenamefullpng)
>         filenamefullcover = filenamefull + "/cover.png"
>         testifisfilecover = os.path.isfile(filenamefullcover)
>         filenamefullcoverjpg = filenamefull + "/cover.jpg"
>         testifisfilecoverjpg = os.path.isfile(filenamefullcoverjpg)
>         seen = "zero" 
> 
> 
>         #f=os.popen(' sh ~/.fvwm/scripts/simplenotify.sh %s' % (filenamefullpng))
>         #f=os.popen(' sh ~/.fvwm/scripts/simplenotify.sh %s' % (filenamefulljpg))
> 
>         if testifisfile == False:
> 			self.canvas.set_from_file(oshome + "/.fvwm/images/notification/no-cover.png")
> 			seen = "zero"
> 			
> 			
>         if testifisfile == True and seen == "zero":
> 			#self.canvas.set_from_file(filenamefullpng)
> 			pixbuf = gtk.gdk.pixbuf_new_from_file(filenamefullpng)
> 			scaled_buf = pixbuf.scale_simple(300, 300, gtk.gdk.INTERP_BILINEAR)
> 			self.canvas.set_from_pixbuf(scaled_buf)		
> 			seen = "seen"
>         if testifisfilejpg == True and seen == "zero":
> 			#self.canvas.set_from_file(filenamefulljpg)
> 			pixbuf = gtk.gdk.pixbuf_new_from_file(filenamefulljpg)
> 			scaled_buf = pixbuf.scale_simple(300, 300, gtk.gdk.INTERP_BILINEAR)
> 			self.canvas.set_from_pixbuf(scaled_buf)		
> 			seen = "seen"
>         if testifisfilecover == True and seen == "zero":
> 			pixbuf = gtk.gdk.pixbuf_new_from_file(filenamefullcover)
> 			scaled_buf = pixbuf.scale_simple(300, 300, gtk.gdk.INTERP_BILINEAR)
> 			self.canvas.set_from_pixbuf(scaled_buf)
> 			seen = "seen"
>         if testifisfilecoverjpg == True and seen == "zero":
> 			pixbuf = gtk.gdk.pixbuf_new_from_file(filenamefullcoverjpg)
> 			scaled_buf = pixbuf.scale_simple(300, 300, gtk.gdk.INTERP_BILINEAR)
> 			self.canvas.set_from_pixbuf(scaled_buf)			
> 			seen = "seen"
> 
> 		#this is too slow
>         #if seen == "zero":
> 		#	valuefoundfile=""
> 		#	DIRECTORY=filenamefull
> 		#	for root, subdirs, files in os.walk(DIRECTORY):
> 		#		for filez in files:
> 		#			if os.path.splitext(filez)[1].lower() in ('.jpg', '.jpeg'):
> 		#				valuefoundfile = os.path.join(root, filez)
> 		#				seen = "seen"
> 		#	print valuefoundfile
> 		#	if seen == "seen":
> 		#		self.canvas.set_from_file(valuefoundfile)
> 
> 		
> 
>     def load_file_list(self):
>         """ Find all images """
>         self.files = []
>         self.index = 0
> 
>         if self.WALK_INSTEAD_LISTDIR:
> 			for filename in os.listdir('.'):
> 				if os.path.exists(os.path.join('.', filename)):
> 					if is_image(filename):
> 						filepath = os.path.join('.', filename)
> 						self.files.append(filepath)
>             #for directory, sub_directories, files in os.walk('.'):
>                 #for filename in files:
> 
>         else:
>             for filename in os.listdir('.'):
>                 if self.is_image(filename):
>                     self.files.append(filename)
> 
>         self.files.sort()
>         print "Images:", self.files
> 
> 
> 
> 
> 
> 
> 
>     def on_button1_clicked(self, widget):
>         f=os.popen("aplay $HOME/.fvwm/sounds/popup.wav")
>         self.fix.set_text( "Hello cooucuo")
>         
>         
> 
> 
>     def keypress(self,widget,event):
>         cevent = event.keyval
> 		# 115 is S
> 		# 65293 is return
> 		# 65364 arrow down #65362 arrow up
>         print cevent
>         if cevent == 115: 
>         	f=os.popen("aplay $HOME/.fvwm/sounds/popup.wav")
>         	self.canvas.set_from_file("rotunda.jpg")
>         	self.fix.set_text(" Pressed S key")
> 	
>         if cevent == 65362:
> 			print "Up"
> 		#	self.treeView.connect("row-activated", self.on_activated)
> 
>         if cevent == 65364:
> 			print "Down"
> 			#print self.treeView.get_selection()
> 			#gtk.TreeSelection.select_all
> 			#select = self.treeView.get_selection()
> 			#self.treeView.emit('row-activated')
> 
> 
> 
> 			
> 
> 			#treeselection = self.treeView.get_selection()
> 			#model, iter = treeselection.get_selected()
> 			#self.statusbar.push(0, text)
> 			#print self.model[row][1]
> 			#self.fix.set_text(" Loading: "+filetxt )
> 		
>         
>         if cevent == 65307: 
>         	#print "ESC key"
>         	exit()
> 
> 		# we press here return
>         if cevent == 65293: 
>         	f=os.popen("aplay $HOME/.fvwm/sounds/popup.wav")
>         	outputstringnow = "The selected file is = " + self.filenameselector   	
>         	print outputstringnow
>         	#self.canvas.set_from_file("13.jpg")
>         	exit()
> 
> 
> 
> 
>     def create_model(self):
>         store = gtk.ListStore(str)
>         actresses = [('jessica alba', 'pomona', '1981'), ('sigourney weaver', 'new york', '1949'),
>             ('angelina jolie', 'los angeles', '1975'), ('natalie portman', 'jerusalem', '1981'),
>             ('rachel weiss', 'london', '1971'), ('scarlett johansson', 'new york', '1984' )]
>         #for act in self.files:
>         #    store.append([act[0], act[1], act[2]])
>         #l = [1,2,3]
>         
>         store = gtk.ListStore(str, str, str)
>         i=1
>         maxindexes=len(self.files)-1
> 
>         for act in range(0, maxindexes, 1):
>             store.append([i, self.files[i], "Info"])
>             i=i+1
> 
>         return store
> 
> 
> 
> 
> 
>     def create_columns(self, treeView):
>     
>         rendererText = gtk.CellRendererText()
>         column = gtk.TreeViewColumn("Nbr", rendererText, text=0)
>         column.set_sort_column_id(0)    
>         treeView.append_column(column)
>         
>         rendererText = gtk.CellRendererText()
>         column = gtk.TreeViewColumn("Filename", rendererText, text=1)
>         column.set_sort_column_id(1)
>         treeView.append_column(column)
> 
>         rendererText = gtk.CellRendererText()
>         column = gtk.TreeViewColumn("Information", rendererText, text=2)
>         column.set_sort_column_id(2)
>         treeView.append_column(column)
> 
> 
> 
> 
> 
>     def on_activated(self, widget, row, col):
>         model = widget.get_model()
>         text = model[row][0] + ", " + model[row][1] + ", " + model[row][2]
>         filetxt=model[row][1]
>         self.statusbar.push(0, text)
>         #self.canvas.set_from_file(filetxt)
>         self.fix.set_text(" Loading: "+filetxt )
> 
> 
> 
> 
> 
> 
> if __name__ == "__main__":
> 
>     # Define all global variables and data structures
> 	global PyApp
> 	global canvas
> 	global treeView
> 	global filenameselector
> 
> 	PyApp()
> 	gtk.main()
> #!/usr/bin/python
> 
> # ZetCode PyGTK tutorial 
> #
> # This example shows a TreeView widget
> # in a list view mode
> #
> # author: jan bodnar
> # website: zetcode.com 
> # last edited: February 2009
> 
> 
> import gtk
> import pango
> import sys
> 
> # I need os to play my sounds
> import os
> 
> #import pygtk
> #pygtk.require('2.0')
> #import gtk
> #import glib
> #import sys
> 
> 
> 
> quotes = """Excess of joy is harder to bear than any amount of sorrow.
> The more one judges, the less one loves.
> There is no such thing as a great talent without great will power. 
> """
> 
> 
> 
> 
> 
> def is_image(filename):
> 	""" File is image if it has a common suffix and it is a regular file """
> 	if not os.path.exists(filename):
> 		return False
> 
> 	for suffix in ['.png','.jpg']:
> 		if filename.lower().endswith(suffix):
> 			return False
> 
> 	return True
> 	
> 
> 
> 
> 
> def is_real_image(filename):
>     """ File is image if it has a common suffix and it is a regular file """
> 
>     if not os.path.isfile(filename):
>         return False
> 
>     for suffix in ['.png','.jpg']:
>         if filename.lower().endswith(suffix):
>             return True
>             # notice here the difference with def above
>             # it will get all the jpg and png
> 
>     return False
> 	
> 
> 
> class PyApp(gtk.Window): 
> 
>     SECONDS_BETWEEN_PICTURES = 3
>     FULLSCREEN = True
>     WALK_INSTEAD_LISTDIR = True
>     
>     
>     def __init__(self):
>         super(PyApp, self).__init__()
>         
>         
>         # here we have the list view
>         self.set_size_request(350, 250)
>         self.set_position(gtk.WIN_POS_CENTER)
>         
>         self.connect("destroy", gtk.main_quit)
>         self.set_title("ListView")
>         # here for key ctrl
>         self.connect('key_press_event', self.keypress)
>         
>         self.index = 0 
>         self.filenameselector=""
>         
>         self.load_file_list()
> 
>         vbox = gtk.VBox(False, 8)
>         
>         sw = gtk.ScrolledWindow()
>         sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
>         sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
>         
>         vbox.pack_start(sw, True, True, 0)
> 
>         store = self.create_model()
> 
>         self.treeView = gtk.TreeView(store)
>         self.treeView.connect("row-activated", self.on_activated)
> 
> 
> 
> 
>         selection = self.treeView.get_selection()
>         selection.set_mode(gtk.SELECTION_BROWSE) 
>         selection.connect('changed', self.selection_changed_cb) 
> 
>         
>         
>         self.treeView.set_rules_hint(True)
>         sw.add(self.treeView)
> 
>         self.create_columns(self.treeView)
>         self.statusbar = gtk.Statusbar()
>         
>         vbox.pack_start(self.statusbar, False, False, 0)
>         
> 
> 
> 
>         # here we have the text stuffs description
>         # it may need pango?
>         # fix is the txt
>         #self.connect("destroy", gtk.main_quit)
>         #self.set_title("Quotes")
>         #self.label = gtk.Label(quotes)
>         #self.fontdesc = pango.FontDescription("Purisa 10")
>         #self.label.modify_font(self.fontdesc)
>         self.fix = gtk.Fixed()
>         #self.fix.put(self.label, 5, 5)
>         #self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
>         self.fix = gtk.Label( "Hello menus")
>         
> 
>         # buttons are here	- buttons are vbox
>         # here the buttons
>         self.set_title("Buttons")
>         btn1 = gtk.Button("Set another name")
>         btn1.set_size_request(80, 30)
>         btn1.connect("clicked", self.on_button1_clicked)
> 		#btn1.set_sensitive(False)
> 		
>         btn2 = gtk.Button("Button2")
>         btn3 = gtk.Button(stock=gtk.STOCK_CLOSE)
>         btn4 = gtk.Button("Button4")
>         btn4.set_size_request(80, 40)
>         fixed = gtk.Fixed()
>         fixed.put(btn1, 20, 30)
>         fixed.put(btn2, 100, 30)
>         fixed.put(btn3, 20, 80)
>         fixed.put(btn4, 100, 80)
>         vbox.connect("destroy", gtk.main_quit)
>         #vbox.add(fixed)
> 
> 
> 
> 
> 		# old with three images
>         # images are here		
>         # it may need sys?
>         #try:
>             #self.bardejov = gtk.gdk.pixbuf_new_from_file("bardejov.jpg")
>             #self.rotunda = gtk.gdk.pixbuf_new_from_file("rotunda.jpg")
>             #self.mincol = gtk.gdk.pixbuf_new_from_file("mincol.tk.Fixed()
>         #fiximages.put(image1, 5, 5)
>         #fiximages.put(image2, 40, 160)
>         #fiximages.put(image3, 170, 50)
> 
> 
> 
> 		# new simple wiht canvas images
> 		#canvas.set_from_file("rotunda.jpg")
>         self.canvas = gtk.Image()
>         vbox.add(self.canvas)
>         self.canvas.show()
>         #self.canvas.set_from_file("bardejov.jpg")
>         
> 
> 
> 
>      # here we display all those stuffs
>         self.add(vbox)
>         #vbox.add(fiximages)
>         # this if you do not want buttons : keep it vbox.add(self.fix)
>         
>         self.fullscreen()
>         self.show_all()
> 
> 
> 
>         
>     def selection_changed_cb(self, selection):
>         model, iter = selection.get_selected()
>         if not iter:  # get_selected returns None when you click on the arrow 
>             return False
>         if model.iter_has_child(iter):
>             return True
> 
>         if not iter:
>             return False
> 
>         name = model.get_value(iter, 1)
>         print "Select: " + name
>         #self.load_module(name)
>         #self.l.sb("file: %s.py" % name) 
>         filetxt = name
>         self.statusbar.push(0, filetxt)
>         #self.canvas.set_from_file(filetxt)
>         self.fix.set_text(" Loading: "+filetxt )
>         self.filenameselector=filetxt
>         filenamefull = os.path.splitext(self.filenameselector)[0]
>         #filenamefull = filenamefulltmp.replace(".fvwmmacosxmplayerplaylistnbr", "")  
>         extension = os.path.splitext(self.filenameselector)[1]
>         filenamefullpng= filenamefull + ".png"
>         filenamefulljpg= filenamefull + ".jpg"
>         oshome = os.environ['HOME']
>         testifisfilejpg = os.path.isfile(filenamefulljpg)
>         testifisfile = os.path.isfile(filenamefullpng)
>         filenamefullcover = filenamefull + "/cover.png"
>         testifisfilecover = os.path.isfile(filenamefullcover)
>         filenamefullcoverjpg = filenamefull + "/cover.jpg"
>         testifisfilecoverjpg = os.path.isfile(filenamefullcoverjpg)
>         seen = "zero" 
> 
> 
>         #f=os.popen(' sh ~/.fvwm/scripts/simplenotify.sh %s' % (filenamefullpng))
>         #f=os.popen(' sh ~/.fvwm/scripts/simplenotify.sh %s' % (filenamefulljpg))
> 
>         if testifisfile == False:
> 			self.canvas.set_from_file(oshome + "/.fvwm/images/notification/no-cover.png")
> 			seen = "zero"
> 			
> 			
>         if testifisfile == True and seen == "zero":
> 			#self.canvas.set_from_file(filenamefullpng)
> 			pixbuf = gtk.gdk.pixbuf_new_from_file(filenamefullpng)
> 			scaled_buf = pixbuf.scale_simple(300, 300, gtk.gdk.INTERP_BILINEAR)
> 			self.canvas.set_from_pixbuf(scaled_buf)		
> 			seen = "seen"
>         if testifisfilejpg == True and seen == "zero":
> 			#self.canvas.set_from_file(filenamefulljpg)
> 			pixbuf = gtk.gdk.pixbuf_new_from_file(filenamefulljpg)
> 			scaled_buf = pixbuf.scale_simple(300, 300, gtk.gdk.INTERP_BILINEAR)
> 			self.canvas.set_from_pixbuf(scaled_buf)		
> 			seen = "seen"
>         if testifisfilecover == True and seen == "zero":
> 			pixbuf = gtk.gdk.pixbuf_new_from_file(filenamefullcover)
> 			scaled_buf = pixbuf.scale_simple(300, 300, gtk.gdk.INTERP_BILINEAR)
> 			self.canvas.set_from_pixbuf(scaled_buf)
> 			seen = "seen"
>         if testifisfilecoverjpg == True and seen == "zero":
> 			pixbuf = gtk.gdk.pixbuf_new_from_file(filenamefullcoverjpg)
> 			scaled_buf = pixbuf.scale_simple(300, 300, gtk.gdk.INTERP_BILINEAR)
> 			self.canvas.set_from_pixbuf(scaled_buf)			
> 			seen = "seen"
> 
> 		#this is too slow
>         #if seen == "zero":
> 		#	valuefoundfile=""
> 		#	DIRECTORY=filenamefull
> 		#	for root, subdirs, files in os.walk(DIRECTORY):
> 		#		for filez in files:
> 		#			if os.path.splitext(filez)[1].lower() in ('.jpg', '.jpeg'):
> 		#				valuefoundfile = os.path.join(root, filez)
> 		#				seen = "seen"
> 		#	print valuefoundfile
> 		#	if seen == "seen":
> 		#		self.canvas.set_from_file(valuefoundfile)
> 
> 		
> 
>     def load_file_list(self):
>         """ Find all images """
>         self.files = []
>         self.index = 0
> 
>         if self.WALK_INSTEAD_LISTDIR:
> 			for filename in os.listdir('.'):
> 				if os.path.exists(os.path.join('.', filename)):
> 					if is_image(filename):
> 						filepath = os.path.join('.', filename)
> 						self.f 
> 
> 
>     def keypress(self,widget,event):
>         cevent = event.keyval
> 		# 115 is S
> 		# 65293 is return
> 		# 65364 arrow down #65362 arrow up
>         print cevent
>         if cevent == 115: 
>         	f=os.popen("aplay $HOME/.fvwm/sounds/popup.wav")
>         	self.canvas.set_from_file("rotunda.jpg")
>         	self.fix.set_text(" Pressed S key")
> 	
>         if cevent == 65362:
> 			print "Up"
> 		#	self.treeView.connect("row-activated", self.on_activated)
> 
>         if cevent == 65364:
> 			print "Down"
> 			#print self.treeView.get_selection()
> 			#gtk.TreeSelection.select_all
> 			#select = self.treeView.get_selection()
> 			#self.treeView.emit('row-activated')
> 
> 
> 
> 			
> 
> 			#treeselection = self.treeView.get_selection()
> 			#model, iter = treeselection.get_selected()
> 			#self.statusbar.push(0, text)
> 			#print self.model[row][1]
> 			#self.fix.set_text(" Loading: "+filetxt )
> 		
>         
>         if cevent == 65307: 
>         	#print "ESC key"
>         	exit()
> 
> 		# we press here return
>         if cevent == 65293: 
>         	f=os.popen("aplay $HOME/.fvwm/sounds/popup.wav")
>         	outputstringnow = "The selected file is = " + self.filenameselector   	
>         	print outputstringnow
>         	#self.canvas.set_from_file("13.jpg")
>         	exit()
> 
> 
> 
> 
>     def create_model(self):
>         store = gtk.ListStore(str)
>         actresses = [('jessica alba', 'pomona', '1981'), ('sigourney weaver', 'new york', '1949'),
>             ('angelina jolie', 'los angeles', '1975'), ('natalie portman', 'jerusalem', '1981'),
>             ('rachel weiss', 'london', '1971'), ('scarlett johansson', 'new york', '1984' )]
>         #for act in self.files:
>         #    store.append([act[0], act[1], act[2]])
>         #l = [1,2,3]
>         
>         store = gtk.ListStore(str, str, str)
>         i=1
>         maxindexes=len(self.files)-1
> 
>         for act in range(0, maxindexes, 1):
>             store.append([i, self.files[i], "Info"])
>             i=i+1
> 
>         return store
> 
> 
> 
> 
> 
>     def create_columns(self, treeView):
>     
>         rendererText = gtk.CellRendererText()
>         column = gtk.TreeViewColumn("Nbr", rendererText, text=0)
>         column.set_sort_column_id(0)    
>         treeView.append_column(column)
>         
>         rendererText = gtk.CellRendererText()
>         column = gtk.TreeViewColumn("Filename", rendererText, text=1)
>         column.set_sort_column_id(1)
>         treeView.append_column(column)
> 
>         rendererText = gtk.CellRendererText()
>         column = gtk.TreeViewColumn("Information", rendererText, text=2)
>         column.set_sort_column_id(2)
>         treeView.append_column(column)
> 
> 
> 
> 
> 
>     def on_activated(self, widget, row, col):
>         model = widget.get_model()
>         text = model[row][0] + ", " + model[row][1] + ", " + model[row][2]
>         filetxt=model[row][1]
>         self.statusbar.push(0, text)
>         #self.canvas.set_from_file(filetxt)
>         self.fix.set_text(" Loading: "+filetxt )
> 
> 
> 
> 
> 
> 
> if __name__ == "__main__":
> 
>     # Define all global variables and data structures
> 	global PyApp
> 	global canvas
> 	global treeView
> 	global filenameselector
> 
> 	PyApp()
> 	gtk.main()
> 
> 
> 
> Regards
> S.
> 
> 
> 
> 
> On Thu, May 17, 2012 at 05:42:02PM +0200, Matthias Arndt wrote:
> > Hello,
> > 
> > for Hatari as I told you before, you have to edit the table 
> > 
> > static JOYAXISMAPPING AxisMappingTable 
> > 
> > in src/joy.c line 65
> > 
> > Add a record for your device, beginning with the exact joystick ID
> > string (the one Hatari shows you) followed by the axis numbers it should
> > use instead of the default ones. Also follow the file commentary.
> > 
> > Recompile Hatari and if it detects the joystick, mapping should be
> > corrected.
> > 
> > Reagrds,
> > Matthias
> > 
> > Am Mittwoch, den 16.05.2012, 20:44 +0200 schrieb sheevastar: 
> > > As information, all input 2 of gamepad have for Event: type 2,
> > > 
> > > 0
> > > 1 
> > > 3
> > > and 4 for most gamepads
> > > 
> > > You take 0 and 1 for hatari
> > > 
> > > my retrolink takes 3 and 4 for up/down/right/left 
> > > 
> > > Kind regards
> > > S.
> > > 
> > > On Mon, May 14, 2012 at 05:24:47PM +0200, Matthias Arndt wrote:
> > > > Hello,
> > > > 
> > > > Please check the jstest output for your device if the axis indicators to
> > > > change or only ON/OFF mappings for the buttons appear.
> > > > 
> > > > If your device does not produce any axis events but button presses only,
> > > > you are out of luck with the current state of Hatari's source code.
> > > > 
> > > > All I can tell you in this case, is to contact the Hatari develeopment
> > > > mailing list, see CC 
> > > > 
> > > > For information on Jabber, please consult Wikipedia or the like. I'm
> > > > sure there are CLI bsed clients available.
> > > > 
> > > > Regards,
> > > > Matthias
> > > > 
> > > > Am Sonntag, den 13.05.2012, 14:13 +0200 schrieb sheevastar: 
> > > > > Hi, 
> > > > > 
> > > > > I do not know how to use / install JABBER with centerim. I am using linux mostly with CLI. Is the jabber secured? 
> > > > > 
> > > > > A new feature or workaround would be great. Since jscal change (remapping) did not work, thus I must change the SDL / hatari settings of this gamepad. 
> > > > > 
> > > > > my retrolink has no stick:
> > > > > http://www.amazon.com/Retro-Classic-Controller-Nintendo-Entertainment-System/dp/B00281PFQI
> > > > > 
> > > > > Since there is no stick like other regular gamepads, i.e. http://www-mp3.us/wp-content/uploads/2009/04/logitech_gamepad.jpg, hatari does not work (up, down, ...)
> > > > > The new featuring for settings of joystick would be anytime welcome. 
> > > > > 
> > > > > Could I eventually change the .hatari/config files to make this retrolink usb gamepad to work?
> > > > > 
> > > > > I am looking forward to hearing you,
> > > > > 
> > > > > Yours sincerely,
> > > > > Sheeva
> > > > > 
> > > > > 
> > > > > On Sun, May 13, 2012 at 09:45:38AM +0200, Matthias Arndt wrote:
> > > > > > Hello,
> > > > > > 
> > > > > > I'm not using ICQ anymore but you may contact me through Google Talk
> > > > > > and/or Jabber (see my ID below)
> > > > > > 
> > > > > > For your joystick problem, well I ran into similar ones and the only
> > > > > > solution was to patch the joystuck subsystem for Hatari.
> > > > > > 
> > > > > > You have to compile a recent build of Hatari (get latest trunk version
> > > > > > from Mercurial) and patch the device table located in the file joy.c,
> > > > > > function Joy_Init()
> > > > > > 
> > > > > > This is a lookup table to assign other values for X and Y axis of the
> > > > > > joystick and they are assigned by the SDL joystick name.
> > > > > > 
> > > > > > So you need the information beforehand which axis actually produce the
> > > > > > right inputs. Use the jstest tool and observe which axis do move with
> > > > > > the stick and/or pad. Then enter the correct values.
> > > > > > 
> > > > > > (BTW if you use the same Speedlink gamepad I showed in my blog, the
> > > > > > first entry within this table should already work.)
> > > > > > 
> > > > > > In the future this information is intended to be saved to configuration
> > > > > > files so noone has to fix it within Hatari itself.
> > > > > > 
> > > > > > At the moment, I lack the time to implement this feature.
> > > > > > 
> > > > > > Regards,
> > > > > > Matthias
> > > > > > 
> > > > > > Am Samstag, den 12.05.2012, 23:52 +0200 schrieb sheevastar: 
> > > > > > > Dear Mathias,
> > > > > > > 
> > > > > > > I would like to ask you about joystick. Would it be possible to release for debian stable squeeze a newer version of hatari with the possibility to 
> > > > > > > configure the joystick inputs.
> > > > > > > 
> > > > > > > I have troubles to run it, my fire works, but not my arrows (up;down;left;right)
> > > > > > > 
> > > > > > > I used jscal on debain stable squeeze but thought still same resutsl
> > > > > > > 
> > > > > > > origianlly when I plug my gamepad (default calibratin from kernel ):
> > > > > > >  jscal -p /dev/input/js0 
> > > > > > > jscal -s 6,1,0,112,142,5534751,5534751,1,0,112,142,5534751,5534751,1,0,112,142,5534751,5534751,1,0,112,142,5534751,5534751,1,0,112,142,5534751,5534751,1,0,3,3,178956970,178956970 /dev/input/js0
> > > > > > > 
> > > > > > > jscal -u 6,0,1,2,3,4,40,10,288,289,290,291,292,293,294,295,296,297 /dev/input/js0
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > And my super modified.
> > > > > > > 
> > > > > > >   jscal -u 6,3,4,0,1,2,40,10,288,289,290,291,292,293,294,295,296,297 /dev/input/js0
> > > > > > >   fire is here working
> > > > > > > 
> > > > > > > but still hatari arrows are not workking.
> > > > > > > 
> > > > > > > My icq : icq_uin 305686267
> > > > > > > 
> > > > > > > Kind regards,
> > > > > > > S.
> > > > > > 
> > > > > > -- 
> > > > > > Matthias Arndt <marndt@xxxxxxxxxxxxxx>
> > > > > > PGP-Key: http://www.final-memory.org/files/marndt.asc
> > > > > > Jabber: simonsunnyboy@xxxxxxxxxxxxxxxx
> > > > > > 
> > > > 
> > > > -- 
> > > > Matthias Arndt <marndt@xxxxxxxxxxxxxx>
> > > > PGP-Key: http://www.final-memory.org/files/marndt.asc
> > > > Jabber: simonsunnyboy@xxxxxxxxxxxxxxxx
> > > > 
> > 
> > -- 
> > Matthias Arndt <marndt@xxxxxxxxxxxxxx>
> > PGP-Key: http://www.final-memory.org/files/marndt.asc
> > Jabber: simonsunnyboy@xxxxxxxxxxxxxxxx
> > 

-- 
Matthias Arndt <marndt@xxxxxxxxxxxxxx>
PGP-Key: http://www.final-memory.org/files/marndt.asc
Jabber: simonsunnyboy@xxxxxxxxxxxxxxxx




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/