Back to index

plone3  3.1.7
demoview.py
Go to the documentation of this file.
00001 # -*- coding: ISO-8859-15 -*-
00002 # Copyright (c) 2005-2007
00003 # Authors: KSS Project Contributors (see docs/CREDITS.txt)
00004 #
00005 # This program is free software; you can redistribute it and/or modify
00006 # it under the terms of the GNU General Public License version 2 as published
00007 # by the Free Software Foundation.
00008 #
00009 # This program is distributed in the hope that it will be useful,
00010 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 # GNU General Public License for more details.
00013 #
00014 # You should have received a copy of the GNU General Public License
00015 # along with this program; if not, write to the Free Software
00016 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00017 # 02111-1307, USA.
00018 #
00019 
00020 from kss.core import KSSView, kssaction
00021 
00022 class KSSDemoView(KSSView):
00023 
00024     @kssaction
00025     def keyEvent(self, keycode):
00026         """XXX"""
00027         keycode = int(keycode)
00028         message = "Keycode: [%i]" % (keycode, )
00029         key = chr(keycode)
00030         if key.isalnum():
00031             message += ', Alpanumeric:"%s"' % (key, )
00032         core = self.getCommandSet('core')
00033         selector = core.getHtmlIdSelector('target')
00034         core.replaceInnerHTML(selector, message)