schemedef for Autohotkey

Discussion Forums discussion schemedef for Autohotkey

This topic contains 0 voices and has 4 replies.

Viewing 5 posts - 1 through 5 (of 5 total)
Author Posts
Author Posts
July 27, 2009 at 1:54 pm #658


I read most scheme and schemedef discussions here. I copied some schemes and tried to change them.

All colors I can change are Keywords with ahk_ at the beginning.

Hope someone can help me to understand how to make this right.


<?xml version="1.0" ?>

<!-- Programmers Notepad scheme for Autohotkey -->



<keyword-class name="keywords1">

Abs ACos Asc ASin ATan AutoTrim BlockInput ahk_a1


<keyword-class name="keywords2">

Abort AboveNormal Add ahk_class ahk_group ahk_id ahk_pid All Alnum Alpha AltSubmit ahk_a2


<keyword-class name="keywords3">

A_AhkPath A_AhkVersion A_AppData A_AppDataCommon ahk_a3


<keyword-class name="keywords4">

Alt AltDown AltUp AppsKey BackSpace ahk_a4



<schemedef name="ahk" title="Autohotkey" author="Rainer Friebel" url="" version="1"

casesensitive="false" braces="[()]">

<!-- Max 2 -->


<!-- Double quotes string, with as an escape character. -->

<stringtype id="0" start=""" end=""" multiline="false" />

<stringtype id="1" start="'" end="'" multiline="false" />



<line start=";" blockStart="/*" blockEnd=" */" />


<numbers start="[0-9]" />

<!-- From here on is the traditional scheme definition block... -->

<lexer name="ahk" />


<style name="Default" key="32" />

<style name="Line Comment" key="1" class="comment" />

<style name="Block Comment" key="2" class="comment" />

<style name="Identifier" key="3" class="identifier" />

<style name="Number" key="4" class="number" />

<style name="keywords1" key="5" class="keyword" />

<style name="ReservedWords" key="6" class="keyword" />

<style name="Keywords3" key="7" class="keyword" />

<style name="Keywords4" key="8" class="keyword" />

<style name="String" key="10" class="string" />

<style name="String 2" key="11" class="string" />

<style name="Special Identifier" key="13" />



<keyword key="0" name="Keywords" class="keywords1"/>

<keyword key="1" name="ReservedWords" class="keywords2"/>

<keyword key="2" name="Keywords3" class="keywords3"/>

<keyword key="3" name="Keywords4" class="keywords4"/>




July 28, 2009 at 1:01 pm #16698


I found two issues until now.

First I have to use small letters for the keywords.

But the keywords starting with ahk_ are not correctly colored as keywords.

May be it has to do with an incorrect identifier phrase.

Can someone explain the correct use?



July 28, 2009 at 3:10 pm #16699


The keywords beginning with ahk_ are now colored with the keywordcolor as i want.

I had forgotten some capital letters in my testfile.

I think i can color labels (subroutine-names) with the identifier, can i?



and how can i color userfunction-names?



July 29, 2009 at 9:12 am #16700

Key Master

Hi, glad you’ve made some progress. The lexer that supports .schemedef files only supports simple syntax: keywords, comments, identifiers and numbers basically. For more advanced parsing you currently need to write a lexer using C or C++.

It appears there is one already written here:

that could probably be integrated into PN. Please open an issue and I’ll take a look:

July 29, 2009 at 9:55 am #16701


Thanks for your answer,

but I do not know much about c or c++, so i can’t make a lexer.

Here is what i can get until now:

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.