From 2b64a84d39eeed5681d0ee5068c7d11a01527750 Mon Sep 17 00:00:00 2001 From: alwin Date: Mon, 28 Feb 2005 09:40:30 +0000 Subject: other keymapping tool - not working this moment, I have to check it out - the reason is that the config file is somewhat easier to understand than from zkbapplet and has a nice config tool. Please don't put it into any repositories this moment. --- (limited to 'noncore/applets/keyhelper/keyhelperapplet/config/RepeaterHandler.cpp') diff --git a/noncore/applets/keyhelper/keyhelperapplet/config/RepeaterHandler.cpp b/noncore/applets/keyhelper/keyhelperapplet/config/RepeaterHandler.cpp new file mode 100644 index 0000000..aeae761 --- a/dev/null +++ b/noncore/applets/keyhelper/keyhelperapplet/config/RepeaterHandler.cpp @@ -0,0 +1,76 @@ +#include "RepeaterHandler.h" + +void RepeaterHandler::dispose(QXmlReader* parser, QXmlContentHandler* parent) +{ + m_parser = parser; + m_parent = parent; + m_parser->setContentHandler(this); +} + +bool RepeaterHandler::startElement(const QString& /* namespaceURI */, + const QString& localName, + const QString& /* qName */, + const QXmlAttributes& attr) +{ + if(localName == "repeat"){ + for(int i=0; isetDelay(delay); + } + } else if(attr.localName(i).lower() == "period"){ + bool ok; + int period = attr.value(i).toInt(&ok); + if(ok){ + m_pRepeater->setPeriod(period); + } + } else if(attr.localName(i).lower() == "mode"){ + /* default mode */ + bool ok; + int mode = attr.value(i).toInt(&ok); + if(ok){ + m_pRepeater->setMode(mode); + } + } + } + } else if(localName == "define"){ + /* 変数初期化 */ + m_code = 0; + m_enable = true; + for(int i=0; i 0){ + /* set repeat enable/disable */ + m_pRepeater->setRepeatable(m_code, m_enable); + } + } else if(localName == "repeater"){ + /* return parent */ + m_parser->setContentHandler(m_parent); + } + return(true); +} -- cgit v0.9.0.2